CLOUDSTACK-7645: UI: Fix method for extending dictionary

Instead of mapping both dictionary JSP files to separate objects, extend
dictionary2's object onto single 'dictionary' object.

-- The previous approach was causing issues on certain dialogs, which were not
opening due to possible missing labels.

Conflicts:
	ui/dictionary2.jsp
This commit is contained in:
Brian Federle 2014-11-12 09:55:27 -08:00
parent b3faab6f42
commit 8ec26fb531
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ under the License.
<fmt:setBundle basename="resources/messages"/>
<% long now = System.currentTimeMillis(); %>
<script type="text/javascript">
dictionary2 = {
$.extend(dictionary, {
'label.rules': '<fmt:message key="label.rules" />',
'label.running.vms': '<fmt:message key="label.running.vms" />',
'label.s3.access_key': '<fmt:message key="label.s3.access_key" />',
@ -1013,5 +1013,5 @@ dictionary2 = {
'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>

View File

@ -407,9 +407,9 @@
// Localization
if (!$.isFunction(cloudStack.localizationFn)) { // i.e., localize is overridden by a plugin/module
cloudStack.localizationFn = function(str) {
// look in dictionary first; if not found, try dictionary2
var localized = dictionary[str];
return localized ? localized : dictionary2[str];
return localized ? localized : str;
};
}