Permalink
Browse files

fix(js): elgg.echo recognizes empty translation strings (does not ret…

…urn key)
  • Loading branch information...
mrclay committed Apr 11, 2016
1 parent b27aee7 commit 1d32b2c2b35cf965af1d703d74fb5adeb2599336
Showing with 9 additions and 1 deletion.
  1. +1 −1 js/lib/languages.js
  2. +8 −0 js/tests/ElggLanguagesTest.js
View
@@ -56,7 +56,7 @@ elgg.echo = function(key, argv, language) {
argv = argv || [];
map = translations[language] || translations[dlang];
- if (map && map[key]) {
+ if (map && elgg.isString(map[key])) {
return vsprintf(map[key], argv);
}
@@ -29,6 +29,14 @@ define(function(require) {
expect(elgg.echo('hello', 'es')).toBe('Hello!');
});
+
+ it("recognizes empty string as a valid translation", function () {
+ elgg.add_translation('en', {
+ 'void': ''
+ });
+
+ expect(elgg.echo('void')).toBe('');
+ });
});
});
});

0 comments on commit 1d32b2c

Please sign in to comment.