Skip to content

Commit 1fb7ab5

Browse files
committed
Merge branch 'language-fixes' of https://github.com/movibe/loopback-angular-admin into movibe-language-fixes
2 parents c5ea2d8 + 751feb9 commit 1fb7ab5

7 files changed

Lines changed: 576 additions & 363 deletions

File tree

client/app/js/app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ angular.module('loopbackApp', [
4646
.run(function($rootScope, gettextCatalog) {
4747

4848
$rootScope.langs = {
49-
pt: gettextCatalog.getString('Portuguese'),
50-
us: gettextCatalog.getString('English'),
51-
nl: gettextCatalog.getString('Dutch'),
52-
de: gettextCatalog.getString('German')
49+
'pt-BR': gettextCatalog.getString('Portuguese Brazil'),
50+
'us': gettextCatalog.getString('English'),
51+
'nl': gettextCatalog.getString('Dutch'),
52+
'de': gettextCatalog.getString('German')
5353
};
5454

5555
var LangVar = navigator.language || navigator.userLanguage;
56-
var userLangVar = LangVar.substring(0, 2);
57-
$rootScope.lang = LangVar.substring (0, 2);
56+
var userLangVar = LangVar.substring(0, 2) + '-' + LangVar.substring(3, 5).toUpperCase();
57+
$rootScope.lang = userLangVar;
5858
gettextCatalog.setCurrentLanguage(userLangVar);
5959

6060
});

client/app/js/translations.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.

client/app/modules/core/views/elements/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<ul class="dropdown-menu">
1717
<li ng-repeat="(index, lang) in langs" ng-show="lang != selectLang">
1818
<a ng-click="setLang(index)">
19-
<span class="flag-icon flag-icon-{{index}}"></span> {{lang | translate }}
19+
<span class="flag-icon flag-icon-{{index.slice(-2).toLowerCase() }}"></span> {{lang | translate }}
2020
</a>
2121
</li>
2222
</ul>

po/pt-BR.mo

4.59 KB
Binary file not shown.

0 commit comments

Comments
 (0)