[BUGFIX][htmlArea RTE] Localization is broken
authorstan <typo3@sjbr.ca>
Thu, 7 Jul 2011 05:28:19 +0000 (01:28 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 7 Jul 2011 05:36:49 +0000 (07:36 +0200)
As a result of Feature #25397: Adding XLIFF support as the default format for translation

Change-Id: Id9ad26a43ca46418a78692fbb11db351243a6851
Resolves: #27928
Releases: 4.6
Reviewed-on: http://review.typo3.org/3070
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index 48ab097..8e6c73b 100644 (file)
@@ -56,10 +56,11 @@ Ext.apply(HTMLArea, {
         ***************************************************/
        localize: function (label, plural) {
                var i = plural || 0;
-               var label = HTMLArea.I18N.dialogs[label] || HTMLArea.I18N.tooltips[label] || HTMLArea.I18N.msg[label] || '';
-               if (label[i] != undefined) {
-                       return label[i]['target'];
+               var localized = HTMLArea.I18N.dialogs[label] || HTMLArea.I18N.tooltips[label] || HTMLArea.I18N.msg[label] || '';
+               if (typeof localized === 'object' && typeof localized[i] !== 'undefined') {
+                       localized = localized[i]['target'];
                }
+               return localized;
        },
        /***************************************************
         * INITIALIZATION                                  *
@@ -4366,8 +4367,15 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
         *
         * @return      string          the localization of the label
         */
-       localize: function (label) {
-               return HTMLArea.localize(label);
+       localize: function (label, plural) {
+               var i = plural || 0;
+               var localized = this.I18N[label];
+               if (typeof localized === 'object' && typeof localized[i] !== 'undefined') {
+                       localized = localized[i]['target'];
+               } else {
+                       localized = HTMLArea.localize(label, plural);
+               }
+               return localized;
        },
        /**
         * Get localized label wrapped with contextual help markup when available