You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2014/11/12 17:32:37 UTC

[1/2] git commit: updated refs/heads/4.5 to 4e820b3

Repository: cloudstack
Updated Branches:
  refs/heads/4.5 f1361796b -> 4e820b37b


CLOUDSTACK-7645: [UI] Fixed incorrect label issues caused the dictionary split

In some cases the UI does not display the correct text, displaying 'label.xyz' instead of the localized string.
This appears to be due to the dictionary split: entries in dictionary2.jsp are not found because the dictionary has not been extended with dictionary2 as expected.

In this fix:
- Instead of extending the dictionary, we leave it as it is and change the localization function to look in the dictionary first and, if the item is not found there, then look in dictionary2.
- This way we are not depending on the extent() function to be called at the 'right' time; In turn, the localization function will be aware of both dictionaries.
- In the future, when we add another dictionary, we will have to modify this function only.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d82e556d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d82e556d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d82e556d

Branch: refs/heads/4.5
Commit: d82e556dcd980bac50f27eaca284983808e04b1c
Parents: f136179
Author: Mihaela Stoica <mi...@citrix.com>
Authored: Tue Nov 11 17:34:50 2014 +0000
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Nov 12 08:21:42 2014 -0800

----------------------------------------------------------------------
 ui/scripts/cloudStack.js      | 9 +++------
 ui/scripts/sharedFunctions.js | 4 +---
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d82e556d/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index c5aa89c..a76e101 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -407,14 +407,11 @@
         // Localization
         if (!$.isFunction(cloudStack.localizationFn)) { // i.e., localize is overridden by a plugin/module
             cloudStack.localizationFn = function(str) {
-                return dictionary[str];
+                // look in dictionary first; if not found, try dictionary2
+                var localized = dictionary[str];
+                return localized ? localized : dictionary2[str]; 
             };
         }
-        
-        //added for dictionary split up
-        if (dictionary != undefined && dictionary2 != undefined) {
-            $.extend(dictionary,dictionary2);
-        }
 
         // Localize validation messages
         cloudStack.localizeValidatorMessages();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d82e556d/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index cba6fc6..6bcc50e 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1454,9 +1454,7 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
         }
         return vmName;
     }
-
-var dictionary = {}, dictionary2 = {}; //for globalization
-    
+  
 var timezoneMap = new Object();
 timezoneMap["Etc/GMT+12"] = "Etc/GMT+12 [GMT-12:00]";
 timezoneMap["Etc/GMT+11"] = "Etc/GMT+11 [GMT-11:00]";


[2/2] git commit: updated refs/heads/4.5 to 4e820b3

Posted by bf...@apache.org.
CLOUDSTACK-7645

[UI] Fix incorrect strings 'label.no' and 'label.added.network.offering'

Conflicts:
	ui/dictionary2.jsp


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4e820b37
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4e820b37
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4e820b37

Branch: refs/heads/4.5
Commit: 4e820b37b0b8f5318e992330a3a9a7f6f9998cff
Parents: d82e556
Author: Mihaela Stoica <mi...@citrix.com>
Authored: Tue Nov 4 16:22:20 2014 +0000
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Nov 12 08:24:10 2014 -0800

----------------------------------------------------------------------
 ui/dictionary2.jsp          | 3 +++
 ui/scripts/configuration.js | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4e820b37/ui/dictionary2.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary2.jsp b/ui/dictionary2.jsp
index 8f2a378..28b4f05 100644
--- a/ui/dictionary2.jsp
+++ b/ui/dictionary2.jsp
@@ -1010,5 +1010,8 @@ dictionary2 = {
 'label.agent.state': '<fmt:message key="label.agent.state" />',
 'label.duration.in.sec': '<fmt:message key="label.duration.in.sec" />',
 'state.detached': '<fmt:message key="state.detached" />',
+'label.na': '<fmt:message key="label.na" />',
+'label.added.network.offering': '<fmt:message key="label.added.network.offering" />',
+'label.no': '<fmt:message key="label.no" />'
 };
 </script>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4e820b37/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index f88ba85..2a9829d 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -3167,7 +3167,7 @@
 
                             messages: {
                                 notification: function(args) {
-                                    return 'label.added.network.offering';
+                                    return 'label.add.network.offering';
                                 }
                             }
                         }