Browse Source

add i18n for sync services'

Gerald 9 years ago
parent
commit
dac8e45d01

+ 7 - 0
src/_locales/cs/messages.yml

@@ -350,15 +350,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: ''
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: ''
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: ''
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: ''
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: ''
@@ -424,3 +428,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 7 - 0
src/_locales/de/messages.yml

@@ -346,15 +346,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: ''
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: ''
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: ''
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: ''
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: ''
@@ -420,3 +424,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 8 - 1
src/_locales/en/messages.yml

@@ -346,15 +346,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: Authorize
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: Authorizing
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: Authorized
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: Sync to $1
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: Last sync at $1
@@ -415,10 +419,13 @@ labelSyncDisabled:
   message: None
 labelSyncService:
   description: Label for sync service select.
-  message: 'Sync to'
+  message: Sync to
 labelSyncAuthorize:
   description: Label for button to authorize a service.
   message: Authorize
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: Revoke
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: Authorizing

+ 7 - 0
src/_locales/id/messages.yml

@@ -352,15 +352,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: Izinkan
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: Mengizinkan
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: Diizinkan
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: Sinkron ke $1
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: Sinkron terakhir pada $1
@@ -426,3 +430,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 7 - 0
src/_locales/pl/messages.yml

@@ -348,15 +348,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: ''
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: ''
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: ''
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: ''
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: ''
@@ -422,3 +426,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 7 - 0
src/_locales/ro/messages.yml

@@ -352,15 +352,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: Autorizează
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: Autorizare
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: Autorizat
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: Sincronizează în $1
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: Ultima sincronizare la $1
@@ -426,3 +430,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 7 - 0
src/_locales/ru/messages.yml

@@ -348,15 +348,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: ''
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: ''
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: ''
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: ''
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: ''
@@ -422,3 +426,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 7 - 0
src/_locales/sr/messages.yml

@@ -350,15 +350,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: Одобри
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: Одобравање
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: Одобрено
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: Синхронизуј са $1
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: 'Последња синхронизација: $1'
@@ -424,3 +428,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 7 - 0
src/_locales/vi/messages.yml

@@ -348,15 +348,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: Xác thực
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: Đang xác thực
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: Đã xác thực
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: Đồng bộ đến $1
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: Đồng bộ cuối lúc $1
@@ -422,3 +426,6 @@ labelSyncAuthorize:
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
   message: ''
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: ''

+ 11 - 4
src/_locales/zh/messages.yml

@@ -348,15 +348,19 @@ labelSync:
 buttonAuthorize:
   description: Button to authorize permissions for sync.
   message: 授权
+  touched: false
 buttonAuthorizing:
   description: Button shown when authorization is in progress.
   message: 正在授权
+  touched: false
 buttonAuthorized:
   description: Button shown when permissions are already authorized for sync.
   message: 已授权
+  touched: false
 labelSyncTo:
   description: Label for sync service.
   message: 同步到 $1
+  touched: false
 lastSync:
   description: Label for last sync timestamp.
   message: 最近同步时间为 $1
@@ -412,13 +416,16 @@ labelSyncScriptStatus:
   message: 同步脚本状态
 labelSyncDisabled:
   description: Label for option to disable sync service.
-  message: ''
+  message: 
 labelSyncService:
   description: Label for sync service select.
-  message: ''
+  message: 同步到
 labelSyncAuthorize:
   description: Label for button to authorize a service.
-  message: ''
+  message: 授权
 labelSyncRevoke:
   description: Label for button to revoke authorization for a service.
-  message: ''
+  message: 取消授权
+labelSyncAuthorizing:
+  description: Label for button when authorization is in progress.
+  message: 授权中

+ 0 - 5
src/options/views/tab-settings/vm-sync/index.js

@@ -2,7 +2,6 @@ var _ = require('src/common');
 var cache = require('src/cache');
 var utils = require('src/options/utils');
 var store = utils.store;
-var SyncService = require('./service');
 
 var SYNC_CURRENT = 'sync.current';
 var syncConfig = {
@@ -16,9 +15,6 @@ _.options.hook(function (data) {
 
 module.exports = {
   template: cache.get('./index.html'),
-  components: {
-    SyncService: SyncService,
-  },
   data: function () {
     return {
       syncConfig: syncConfig,
@@ -74,7 +70,6 @@ module.exports = {
       var service = this.service;
       if (service.authState === 'authorizing') return _.i18n('labelSyncAuthorizing');
       if (service.authState === 'authorized') return _.i18n('labelSyncRevoke');
-      if (service.authState === 'error') return _.i18n('labelSyncAuthError');
       return _.i18n('labelSyncAuthorize');
     },
     canAuthorize: function () {

+ 0 - 12
src/options/views/tab-settings/vm-sync/service.html

@@ -1,12 +0,0 @@
-<div class="mt-1">
-  <label>
-    <input type=checkbox v-setting="keyEnabled" @change="update">
-    <span v-text="labelText"></span>
-  </label>
-  <button @click="authenticate" v-text="labelAuthenticate"
-  :disabled="service.authState!=='unauthorized'"></button>
-  <button :disabled="disableSync" class="sync-start" @click="retry">
-    <svg class="icon"><use xlink:href="#refresh"/></svg>
-  </button>
-  <span v-text="message"></span>
-</div>

+ 0 - 61
src/options/views/tab-settings/vm-sync/service.js

@@ -1,61 +0,0 @@
-var _ = require('src/common');
-var cache = require('src/cache');
-
-module.exports = {
-  props: ['service'],
-  template: cache.get('./service.html'),
-  computed: {
-    keyEnabled: function () {
-      return this.service.name + '.enabled';
-    },
-    labelText: function () {
-      var service = this.service;
-      return _.i18n('labelSyncTo', service.displayName || service.name);
-    },
-    labelAuthenticate: function () {
-      return {
-        authorized: _.i18n('buttonAuthorized'),
-        authorizing: _.i18n('buttonAuthorizing'),
-      }[this.service.authState] || _.i18n('buttonAuthorize');
-    },
-    disableSync: function () {
-      var service = this.service;
-      return !!(
-        ['authorized', 'error'].indexOf(service.authState) < 0 ||
-        ~['ready', 'syncing'].indexOf(service.syncState)
-      );
-    },
-    message: function () {
-      var service = this.service;
-      if (service.authState === 'initializing') return _.i18n('msgSyncInit');
-      if (service.authState === 'error') return _.i18n('msgSyncInitError');
-      if (service.syncState === 'error') return _.i18n('msgSyncError');
-      if (service.syncState === 'ready') return _.i18n('msgSyncReady');
-      if (service.syncState === 'syncing') {
-        var progress = '';
-        if (service.progress && service.progress.total) {
-          progress = ' (' + service.progress.finished + '/' + service.progress.total + ')';
-        }
-        return _.i18n('msgSyncing') + progress;
-      }
-      if (service.lastSync) {
-        var lastSync = new Date(service.lastSync).toLocaleString();
-        return _.i18n('lastSync', lastSync);
-      }
-    },
-  },
-  methods: {
-    retry: function () {
-      _.sendMessage({
-        cmd: 'SyncStart',
-        data: this.service.name,
-      });
-    },
-    authenticate: function () {
-      _.sendMessage({cmd: 'Authenticate', data: this.service.name});
-    },
-    update: function (e) {
-      e.target.checked && this.$emit('service-checked', this.service.name);
-    },
-  },
-};