Skip to content

Commit 64af4ae

Browse files
committed
Move isUpperCaseTags out of getString.
1 parent c6bbb0f commit 64af4ae

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

dist/angular-gettext.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ angular.module('gettext').constant('gettext', function (str) {
1313
angular.module('gettext').factory('gettextCatalog', ["gettextPlurals", "$http", "$cacheFactory", "$interpolate", "$rootScope", function (gettextPlurals, $http, $cacheFactory, $interpolate, $rootScope) {
1414
var catalog;
1515

16+
// IE8 returns UPPER CASE tags, even though the source is lower case.
17+
// This can causes the (key) string in the DOM to have a different case to
18+
// the string in the `po` files.
19+
var test = '<span>test</span>';
20+
var isUpperCaseTags = (angular.element('<span>' + test + '</span>').html() !== test);
21+
1622
var prefixDebug = function (string) {
1723
if (catalog.debug && catalog.currentLanguage !== catalog.baseLanguage) {
1824
return catalog.debugPrefix + string;
@@ -53,12 +59,6 @@ angular.module('gettext').factory('gettextCatalog', ["gettextPlurals", "$http",
5359
if (!this.strings[language]) {
5460
this.strings[language] = {};
5561
}
56-
// IE8 returns UPPER CASE tags, even though the source is lower
57-
// case.
58-
// This can causes the (key) string in the DOM to have a different
59-
// case to the string in the `po` files.
60-
var test = '<span>test</span>';
61-
var isUpperCaseTags = (angular.element('<span>' + test + '</span>').html() !== test);
6262
for (var key in strings) {
6363
var val = strings[key];
6464
if (isUpperCaseTags) {

dist/angular-gettext.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/catalog.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
angular.module('gettext').factory('gettextCatalog', function (gettextPlurals, $http, $cacheFactory, $interpolate, $rootScope) {
22
var catalog;
33

4+
// IE8 returns UPPER CASE tags, even though the source is lower case.
5+
// This can causes the (key) string in the DOM to have a different case to
6+
// the string in the `po` files.
7+
var test = '<span>test</span>';
8+
var isUpperCaseTags = (angular.element('<span>' + test + '</span>').html() !== test);
9+
410
var prefixDebug = function (string) {
511
if (catalog.debug && catalog.currentLanguage !== catalog.baseLanguage) {
612
return catalog.debugPrefix + string;
@@ -41,12 +47,7 @@ angular.module('gettext').factory('gettextCatalog', function (gettextPlurals, $h
4147
if (!this.strings[language]) {
4248
this.strings[language] = {};
4349
}
44-
// IE8 returns UPPER CASE tags, even though the source is lower
45-
// case.
46-
// This can causes the (key) string in the DOM to have a different
47-
// case to the string in the `po` files.
48-
var test = '<span>test</span>';
49-
var isUpperCaseTags = (angular.element('<span>' + test + '</span>').html() !== test);
50+
5051
for (var key in strings) {
5152
var val = strings[key];
5253
if (isUpperCaseTags) {

0 commit comments

Comments
 (0)