Permalink
Browse files
fixed non existing translation bug. removed legacy code.
- Loading branch information...
Showing
with
5 additions
and
6 deletions.
-
+5
−6
lib/dialect.js
|
@@ -121,10 +121,14 @@ module.exports = function (options) { |
|
|
throw Error("Original string and target locale are mandatory");
|
|
|
}
|
|
|
|
|
|
- if (!translation || typeof translation !== 'string') {
|
|
|
+ if (typeof translation !== 'string') {
|
|
|
throw Error("Translation is mandatory");
|
|
|
}
|
|
|
|
|
|
+ if (translation.length === 0) {
|
|
|
+ translation = null;
|
|
|
+ }
|
|
|
+
|
|
|
// Database
|
|
|
DIALECT.store.set(query, {translation: translation}, cb);
|
|
|
|
|
@@ -195,10 +199,5 @@ module.exports = function (options) { |
|
|
_options.current_locale = _options.current_locale || 'en';
|
|
|
_options.locales = _options.locales || ['en'];
|
|
|
|
|
|
- ['current_locale', 'base_locale'].forEach(function (conf) {
|
|
|
- DIALECT.config(conf, _options[conf]);
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
return DIALECT;
|
|
|
};
|
0 comments on commit
2a808b9