From 30b7ce263f2f4e93d3c0e34676954526d93dfce0 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Sat, 21 Mar 2015 00:23:41 +0400 Subject: [PATCH] i18n optimizations --- dev/Common/Translator.js | 38 +++++----- dev/View/Popup/Contacts.js | 8 +- .../app/templates/Views/Admin/AdminMenu.html | 4 +- .../Common/PopupsKeyboardShortcutsHelp.html | 74 +++++++++---------- .../Views/Common/PopupsLanguages.html | 2 +- .../templates/Views/Components/Checkbox.html | 2 +- .../Views/Components/CheckboxClassic.html | 2 +- .../Components/CheckboxMaterialDesign.html | 2 +- .../app/templates/Views/Components/Input.html | 6 +- .../app/templates/Views/Components/Radio.html | 2 +- .../templates/Views/Components/Select.html | 4 +- .../templates/Views/Components/TextArea.html | 4 +- .../0.0.0/app/templates/Views/User/Login.html | 19 ++--- .../templates/Views/User/MailMessageList.html | 28 +++---- .../templates/Views/User/MailMessageView.html | 56 +++++++------- .../app/templates/Views/User/PhotoSwipe.html | 10 +-- .../templates/Views/User/PopupsAccount.html | 12 +-- .../Views/User/PopupsAddOpenPgpKey.html | 4 +- .../Views/User/PopupsAdvancedSearch.html | 28 +++---- .../templates/Views/User/PopupsCompose.html | 40 +++++----- .../Views/User/PopupsComposeOpenPgp.html | 10 +-- .../templates/Views/User/PopupsContacts.html | 50 ++++++------- .../templates/Views/User/PopupsFilter.html | 25 ++++--- .../Views/User/PopupsFolderClear.html | 10 +-- .../Views/User/PopupsFolderCreate.html | 8 +- .../Views/User/PopupsFolderSystem.html | 12 +-- .../templates/Views/User/PopupsIdentity.html | 22 +++--- .../Views/User/PopupsNewOpenPgpKey.html | 12 +-- .../templates/Views/User/PopupsTemplate.html | 10 +-- .../Views/User/PopupsTwoFactorTest.html | 6 +- .../Views/User/PopupsViewOpenPgpKey.html | 6 +- .../Views/User/PopupsWindowSimpleMessage.html | 16 ++-- .../Views/User/SettingsAccounts.html | 14 ++-- .../Views/User/SettingsChangePassword.html | 10 +-- .../Views/User/SettingsContacts.html | 10 +-- .../templates/Views/User/SettingsFilters.html | 12 +-- .../User/SettingsFiltersActionForward.html | 4 +- .../User/SettingsFiltersActionReject.html | 2 +- .../User/SettingsFiltersActionVacation.html | 6 +- .../Views/User/SettingsFolderItem.html | 2 +- .../templates/Views/User/SettingsFolders.html | 10 +-- .../templates/Views/User/SettingsGeneral.html | 14 ++-- .../templates/Views/User/SettingsMenu.html | 4 +- .../templates/Views/User/SettingsOpenPGP.html | 14 ++-- .../templates/Views/User/SettingsPane.html | 2 +- .../Views/User/SettingsSecurity.html | 26 +++---- .../templates/Views/User/SettingsSocial.html | 24 +++--- .../Views/User/SettingsTemplates.html | 6 +- .../templates/Views/User/SettingsThemes.html | 6 +- .../templates/Views/User/SystemDropDown.html | 8 +- 50 files changed, 353 insertions(+), 353 deletions(-) diff --git a/dev/Common/Translator.js b/dev/Common/Translator.js index cb64166c4..c63e6a741 100644 --- a/dev/Common/Translator.js +++ b/dev/Common/Translator.js @@ -66,29 +66,27 @@ $oEl = $(oElement) ; - sKey = $oEl.data('i18n-text'); + sKey = $oEl.data('i18n'); if (sKey) { - $oEl.text(this.i18n(sKey)); - } - else - { - sKey = $oEl.data('i18n-html'); - if (sKey) + if ('[' === sKey.substr(0, 1)) { - $oEl.html(this.i18n(sKey)); + switch (sKey.substr(0, 6)) + { + case '[html]': + $oEl.html(this.i18n(sKey.substr(6))); + break; + case '[place': + $oEl.attr('placeholder', this.i18n(sKey.substr(13))); + break; + case '[title': + $oEl.attr('title', this.i18n(sKey.substr(7))); + break; + } } - - sKey = $oEl.data('i18n-placeholder'); - if (sKey) + else { - $oEl.attr('placeholder', this.i18n(sKey)); - } - - sKey = $oEl.data('i18n-title'); - if (sKey) - { - $oEl.attr('title', this.i18n(sKey)); + $oEl.text(this.i18n(sKey)); } } }; @@ -102,13 +100,13 @@ var self = this; _.defer(function () { - $('.i18n', oElements).each(function () { + $('[data-i18n]', oElements).each(function () { self.i18nToNode(this); }); if (bAnimate && Globals.bAnimationSupported) { - $('.i18n-animation.i18n', oElements).letterfx({ + $('.i18n-animation[data-i18n]', oElements).letterfx({ 'fx': 'fall fade', 'backwards': false, 'timing': 50, 'fx_duration': '50ms', 'letter_end': 'restore', 'element_end': 'restore' }); } diff --git a/dev/View/Popup/Contacts.js b/dev/View/Popup/Contacts.js index cbe6863fb..08e7d2b80 100644 --- a/dev/View/Popup/Contacts.js +++ b/dev/View/Popup/Contacts.js @@ -405,7 +405,7 @@ kn.extendAsViewModel(['View/Popup/Contacts', 'PopupsContactsViewModel'], ContactsPopupView); _.extend(ContactsPopupView.prototype, AbstractView.prototype); - ContactsPopupView.prototype.getPropertyPlceholder = function (sType) + ContactsPopupView.prototype.getPropertyPlaceholder = function (sType) { var sResult = ''; switch (sType) @@ -426,7 +426,7 @@ ContactsPopupView.prototype.addNewProperty = function (sType, sTypeStr) { - this.viewProperties.push(new ContactPropertyModel(sType, sTypeStr || '', '', true, this.getPropertyPlceholder(sType))); + this.viewProperties.push(new ContactPropertyModel(sType, sTypeStr || '', '', true, this.getPropertyPlaceholder(sType))); }; ContactsPopupView.prototype.addNewOrFocusProperty = function (sType, sTypeStr) @@ -649,10 +649,10 @@ } aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.LastName, '', sLastName, false, - this.getPropertyPlceholder(Enums.ContactPropertyType.LastName))); + this.getPropertyPlaceholder(Enums.ContactPropertyType.LastName))); aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.FirstName, '', sFirstName, !oContact, - this.getPropertyPlceholder(Enums.ContactPropertyType.FirstName))); + this.getPropertyPlaceholder(Enums.ContactPropertyType.FirstName))); this.viewID(sId); diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminMenu.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminMenu.html index 13fdc3ece..673634bbb 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminMenu.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminMenu.html @@ -10,12 +10,12 @@
- + - +
diff --git a/rainloop/v/0.0.0/app/templates/Views/Common/PopupsKeyboardShortcutsHelp.html b/rainloop/v/0.0.0/app/templates/Views/Common/PopupsKeyboardShortcutsHelp.html index 22d4deb70..f027a6f4a 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Common/PopupsKeyboardShortcutsHelp.html +++ b/rainloop/v/0.0.0/app/templates/Views/Common/PopupsKeyboardShortcutsHelp.html @@ -2,21 +2,21 @@ \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/templates/Views/Components/Select.html b/rainloop/v/0.0.0/app/templates/Views/Components/Select.html index 84a524bf9..0cdcdf4dc 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Components/Select.html +++ b/rainloop/v/0.0.0/app/templates/Views/Components/Select.html @@ -1,12 +1,12 @@ - +      - +   diff --git a/rainloop/v/0.0.0/app/templates/Views/Components/TextArea.html b/rainloop/v/0.0.0/app/templates/Views/Components/TextArea.html index e403fb2ea..3565e30b7 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Components/TextArea.html +++ b/rainloop/v/0.0.0/app/templates/Views/Components/TextArea.html @@ -1,5 +1,5 @@ - +  
- + data-bind="textInput: email, hasFocus: emailFocus" data-i18n="[placeholder]LOGIN/LABEL_EMAIL" /> @@ -35,7 +36,7 @@
+ data-bind="textInput: password, hasFocus: passwordFocus" data-i18n="[placeholder]LOGIN/LABEL_PASSWORD" /> @@ -44,7 +45,7 @@
+ data-bind="textInput: additionalCode, hasFocus: additionalCode.focused" data-i18n="[placeholder]LOGIN/LABEL_VERIFICATION_CODE" /> @@ -54,14 +55,14 @@
{{INCLUDE/BottomControlGroup/PLACE}}
@@ -82,18 +83,18 @@
 
diff --git a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html index 22b360754..f1963ead6 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html @@ -53,35 +53,35 @@    - + @@ -89,7 +89,7 @@    - + @@ -97,14 +97,14 @@    - + @@ -117,7 +117,7 @@
+ data-i18n="[placeholder]SEARCH/MAIN_INPUT_PLACEHOLDER" data-bind="value: inputProxyMessageListSearch, onEnter: searchEnterAction, hasfocus: inputMessageListSearchFocus" /> @@ -140,23 +140,23 @@
   - +
- +
- +
- ... + ...
- +
diff --git a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html index 9e08f2d0f..86dcdbd9f 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageView.html @@ -50,7 +50,7 @@
- +
@@ -74,7 +74,7 @@    - + @@ -112,28 +112,28 @@    - + @@ -141,14 +141,14 @@    - + @@ -156,14 +156,14 @@    - + @@ -252,7 +252,7 @@ data-bind="text: viewThreadsControlDesc">) ! - +
@@ -265,7 +265,7 @@ - : + : @@ -278,7 +278,7 @@
- : + :  
@@ -288,27 +288,27 @@
- : + :  
- : + :  
- : + :  
- : + :  
- : + :     @@ -335,7 +335,7 @@
- ... + ...
@@ -343,12 +343,12 @@
   - +
   - +
@@ -358,16 +358,16 @@
   - +
   - +    + style="margin-bottom: 0" data-i18n="[placeholder]MESSAGE/PGP_PASSWORD_INPUT_PLACEHOLDER" data-bind="value: viewPgpPassword, onEnter: function() { decryptPgpEncryptedMessage(message()); }" />
    diff --git a/rainloop/v/0.0.0/app/templates/Views/User/PhotoSwipe.html b/rainloop/v/0.0.0/app/templates/Views/User/PhotoSwipe.html index 055b5de52..f256ed71f 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/PhotoSwipe.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/PhotoSwipe.html @@ -9,9 +9,9 @@
    - - - + + +
    @@ -23,8 +23,8 @@ - - + +
    diff --git a/rainloop/v/0.0.0/app/templates/Views/User/PopupsAccount.html b/rainloop/v/0.0.0/app/templates/Views/User/PopupsAccount.html index 77ce5fa4e..02f49708c 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/PopupsAccount.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/PopupsAccount.html @@ -4,8 +4,8 @@
    - +
    - +
    @@ -41,8 +41,8 @@    - - + +
    diff --git a/rainloop/v/0.0.0/app/templates/Views/User/PopupsAddOpenPgpKey.html b/rainloop/v/0.0.0/app/templates/Views/User/PopupsAddOpenPgpKey.html index e823a5a99..e2b0374e8 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/PopupsAddOpenPgpKey.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/PopupsAddOpenPgpKey.html @@ -4,7 +4,7 @@
    diff --git a/rainloop/v/0.0.0/app/templates/Views/User/PopupsAdvancedSearch.html b/rainloop/v/0.0.0/app/templates/Views/User/PopupsAdvancedSearch.html index 2797989f7..508979073 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/PopupsAdvancedSearch.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/PopupsAdvancedSearch.html @@ -3,7 +3,7 @@
@@ -92,15 +92,15 @@
 
-    -    -   @@ -109,19 +109,19 @@
- +
- +
@@ -129,7 +129,7 @@
- +
@@ -137,7 +137,7 @@
- +
@@ -145,7 +145,7 @@
- +
@@ -171,10 +171,10 @@
- + - +
@@ -203,11 +203,11 @@
- +
    - +
    diff --git a/rainloop/v/0.0.0/app/templates/Views/User/PopupsComposeOpenPgp.html b/rainloop/v/0.0.0/app/templates/Views/User/PopupsComposeOpenPgp.html index f53b05163..68e6051a0 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/PopupsComposeOpenPgp.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/PopupsComposeOpenPgp.html @@ -4,7 +4,7 @@
    - +
    @@ -44,9 +44,9 @@
    diff --git a/rainloop/v/0.0.0/app/templates/Views/User/PopupsContacts.html b/rainloop/v/0.0.0/app/templates/Views/User/PopupsContacts.html index 44e5009a5..9c348f6e5 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/PopupsContacts.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/PopupsContacts.html @@ -10,7 +10,7 @@    - +
    @@ -37,7 +37,7 @@    - + @@ -45,14 +45,14 @@    - + @@ -60,7 +60,7 @@    - + @@ -71,22 +71,22 @@