Fix icons for russian interface
This commit is contained in:
parent
f6dec13893
commit
62a47e5417
|
@ -38,7 +38,8 @@ Common.Locale = new(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
var l10n = null;
|
var l10n = null;
|
||||||
var loadcallback,
|
var loadcallback,
|
||||||
apply = false;
|
apply = false,
|
||||||
|
currentLang = 'en';
|
||||||
|
|
||||||
var _applyLocalization = function(callback) {
|
var _applyLocalization = function(callback) {
|
||||||
try {
|
try {
|
||||||
|
@ -78,6 +79,10 @@ Common.Locale = new(function() {
|
||||||
return res || (scope ? eval(scope.name).prototype[prop] : '');
|
return res || (scope ? eval(scope.name).prototype[prop] : '');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var _getCurrentLanguage = function() {
|
||||||
|
return (currentLang || 'en');
|
||||||
|
};
|
||||||
|
|
||||||
var _getUrlParameterByName = function(name) {
|
var _getUrlParameterByName = function(name) {
|
||||||
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
||||||
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
||||||
|
@ -87,9 +92,11 @@ Common.Locale = new(function() {
|
||||||
|
|
||||||
var _requireLang = function () {
|
var _requireLang = function () {
|
||||||
var lang = (_getUrlParameterByName('lang') || 'en').split(/[\-_]/)[0];
|
var lang = (_getUrlParameterByName('lang') || 'en').split(/[\-_]/)[0];
|
||||||
|
currentLang = lang;
|
||||||
fetch('locale/' + lang + '.json')
|
fetch('locale/' + lang + '.json')
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
currentLang = 'en';
|
||||||
if (lang != 'en')
|
if (lang != 'en')
|
||||||
/* load default lang if fetch failed */
|
/* load default lang if fetch failed */
|
||||||
return fetch('locale/en.json');
|
return fetch('locale/en.json');
|
||||||
|
@ -130,7 +137,8 @@ Common.Locale = new(function() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
apply: _applyLocalization,
|
apply: _applyLocalization,
|
||||||
get: _get
|
get: _get,
|
||||||
|
getCurrentLanguage: _getCurrentLanguage
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -601,6 +601,9 @@ define([
|
||||||
|
|
||||||
this.$window = $('#' + this.initConfig.id);
|
this.$window = $('#' + this.initConfig.id);
|
||||||
|
|
||||||
|
if (Common.Locale.getCurrentLanguage() !== 'en')
|
||||||
|
this.$window.attr('applang', Common.Locale.getCurrentLanguage());
|
||||||
|
|
||||||
this.binding.keydown = _.bind(_keydown,this);
|
this.binding.keydown = _.bind(_keydown,this);
|
||||||
// $(document).on('keydown', this.binding.keydown);
|
// $(document).on('keydown', this.binding.keydown);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue