Skip to content

Commit a5e8547

Browse files
committed
fix(catalog): use updated keys for translation retrieval
Fixes rubenv#301 See: rubenv#312 Note: this commit / fork is just a temporary hold over to npm install from until this is officially fixed upstream.
1 parent 7d7ac67 commit a5e8547

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

dist/angular-gettext.js

+7
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ angular.module('gettext').factory('gettextCatalog', ["gettextPlurals", "gettextF
262262
if (!language) {
263263
return null;
264264
}
265+
266+
// If we replaced the key in setStrings() then do it again
267+
// for retrieval (#301).
268+
if (isHTMLModified) {
269+
string = angular.element('<span>' + string + '</span>').html();
270+
}
271+
265272
var stringTable = this.strings[language] || {};
266273
var contexts = stringTable[string] || {};
267274
var plurals = contexts[context || noContext] || [];

dist/angular-gettext.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/catalog.js

+7
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,13 @@ angular.module('gettext').factory('gettextCatalog', function (gettextPlurals, ge
210210
if (!language) {
211211
return null;
212212
}
213+
214+
// If we replaced the key in setStrings() then do it again
215+
// for retrieval (#301).
216+
if (isHTMLModified) {
217+
string = angular.element('<span>' + string + '</span>').html();
218+
}
219+
213220
var stringTable = this.strings[language] || {};
214221
var contexts = stringTable[string] || {};
215222
var plurals = contexts[context || noContext] || [];

0 commit comments

Comments
 (0)