Permalink
Browse files

fixed non existing translation bug. removed legacy code.

  • Loading branch information...
masylum committed Apr 3, 2011
1 parent 71caac8 commit 2a808b9d8b53ad12be2b3658f387068bf7101ec3
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/dialect.js
View
@@ -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

Please sign in to comment.