Permalink
Browse files

fixes usage of key/nssepator in plural, context and objtree usage

  • Loading branch information...
jamuhl committed Feb 11, 2013
1 parent 7a48021 commit cd62e4ca9c8b64384f2d7d7a9be5d5f45e0126fe
@@ -822,7 +822,7 @@
delete optionWithoutCount.context;
optionWithoutCount.defaultValue = o.contextNotFound;
- var contextKey = ns + ':' + key + '_' + options.context;
+ var contextKey = ns + o.nsseparator + key + '_' + options.context;
translated = translate(contextKey, optionWithoutCount);
if (translated != o.contextNotFound) {
@@ -835,12 +835,12 @@
delete optionWithoutCount.count;
optionWithoutCount.defaultValue = o.pluralNotFound;
- var pluralKey = ns + ':' + key + o.pluralSuffix;
+ var pluralKey = ns + o.nsseparator + key + o.pluralSuffix;
var pluralExtension = pluralExtensions.get(currentLng, options.count);
if (pluralExtension >= 0) {
pluralKey = pluralKey + '_' + pluralExtension;
} else if (pluralExtension === 1) {
- pluralKey = ns + ':' + key; // singular
+ pluralKey = ns + o.nsseparator + key; // singular
}
translated = translate(pluralKey, optionWithoutCount);
@@ -878,7 +878,7 @@
} else {
for (var m in value) {
// apply translation on childs
- value[m] = _translate(ns + ':' + key + '.' + m, options);
+ value[m] = _translate(ns + o.nsseparator + key + o.keyseparator + m, options);
}
}
}
Binary file not shown.
@@ -818,7 +818,7 @@
delete optionWithoutCount.context;
optionWithoutCount.defaultValue = o.contextNotFound;
- var contextKey = ns + ':' + key + '_' + options.context;
+ var contextKey = ns + o.nsseparator + key + '_' + options.context;
translated = translate(contextKey, optionWithoutCount);
if (translated != o.contextNotFound) {
@@ -831,12 +831,12 @@
delete optionWithoutCount.count;
optionWithoutCount.defaultValue = o.pluralNotFound;
- var pluralKey = ns + ':' + key + o.pluralSuffix;
+ var pluralKey = ns + o.nsseparator + key + o.pluralSuffix;
var pluralExtension = pluralExtensions.get(currentLng, options.count);
if (pluralExtension >= 0) {
pluralKey = pluralKey + '_' + pluralExtension;
} else if (pluralExtension === 1) {
- pluralKey = ns + ':' + key; // singular
+ pluralKey = ns + o.nsseparator + key; // singular
}
translated = translate(pluralKey, optionWithoutCount);
@@ -874,7 +874,7 @@
} else {
for (var m in value) {
// apply translation on childs
- value[m] = _translate(ns + ':' + key + '.' + m, options);
+ value[m] = _translate(ns + o.nsseparator + key + o.keyseparator + m, options);
}
}
}
Binary file not shown.
@@ -819,7 +819,7 @@
delete optionWithoutCount.context;
optionWithoutCount.defaultValue = o.contextNotFound;
- var contextKey = ns + ':' + key + '_' + options.context;
+ var contextKey = ns + o.nsseparator + key + '_' + options.context;
translated = translate(contextKey, optionWithoutCount);
if (translated != o.contextNotFound) {
@@ -832,12 +832,12 @@
delete optionWithoutCount.count;
optionWithoutCount.defaultValue = o.pluralNotFound;
- var pluralKey = ns + ':' + key + o.pluralSuffix;
+ var pluralKey = ns + o.nsseparator + key + o.pluralSuffix;
var pluralExtension = pluralExtensions.get(currentLng, options.count);
if (pluralExtension >= 0) {
pluralKey = pluralKey + '_' + pluralExtension;
} else if (pluralExtension === 1) {
- pluralKey = ns + ':' + key; // singular
+ pluralKey = ns + o.nsseparator + key; // singular
}
translated = translate(pluralKey, optionWithoutCount);
@@ -875,7 +875,7 @@
} else {
for (var m in value) {
// apply translation on childs
- value[m] = _translate(ns + ':' + key + '.' + m, options);
+ value[m] = _translate(ns + o.nsseparator + key + o.keyseparator + m, options);
}
}
}
View
@@ -76,7 +76,7 @@ function _translate(key, options){
delete optionWithoutCount.context;
optionWithoutCount.defaultValue = o.contextNotFound;
- var contextKey = ns + ':' + key + '_' + options.context;
+ var contextKey = ns + o.nsseparator + key + '_' + options.context;
translated = translate(contextKey, optionWithoutCount);
if (translated != o.contextNotFound) {
@@ -89,12 +89,12 @@ function _translate(key, options){
delete optionWithoutCount.count;
optionWithoutCount.defaultValue = o.pluralNotFound;
- var pluralKey = ns + ':' + key + o.pluralSuffix;
+ var pluralKey = ns + o.nsseparator + key + o.pluralSuffix;
var pluralExtension = pluralExtensions.get(currentLng, options.count);
if (pluralExtension >= 0) {
pluralKey = pluralKey + '_' + pluralExtension;
} else if (pluralExtension === 1) {
- pluralKey = ns + ':' + key; // singular
+ pluralKey = ns + o.nsseparator + key; // singular
}
translated = translate(pluralKey, optionWithoutCount);
@@ -132,7 +132,7 @@ function _translate(key, options){
} else {
for (var m in value) {
// apply translation on childs
- value[m] = _translate(ns + ':' + key + '.' + m, options);
+ value[m] = _translate(ns + o.nsseparator + key + o.keyseparator + m, options);
}
}
}

0 comments on commit cd62e4c

Please sign in to comment.