source/i18n.js in i18n-js-0.1.4 vs source/i18n.js in i18n-js-0.1.5
- old
+ new
@@ -2,10 +2,13 @@
var I18n = I18n || {};
// Set default locale to english
I18n.defaultLocale = "en";
+// Set default separator
+I18n.defaultSeparator = ".";
+
// Set current locale to null
I18n.locale = null;
// Set the placeholder format. Accepts `{{placeholder}}` and `%{placeholder}`.
I18n.PLACEHOLDER = /(?:\{\{|%\{)(.*?)(?:\}\}?)/gm;
@@ -18,17 +21,17 @@
if (!messages) {
return;
}
if (typeof(scope) == "object") {
- scope = scope.join(".");
+ scope = scope.join(this.defaultSeparator);
}
if (options.scope) {
- scope = options.scope.toString() + "." + scope;
+ scope = options.scope.toString() + this.defaultSeparator + scope;
}
- scope = scope.split(".");
+ scope = scope.split(this.defaultSeparator);
while (scope.length > 0) {
var currentScope = scope.shift();
messages = messages[currentScope];