(I #2765) Fix i18n not working in the Edit Pref Window (#2766)

* Fix i18n not working in the Edit Pref Window

Fix i18n not working in the Edit Pref Window, added an error message on failure.

* réussie -> réussi.
This commit is contained in:
Antoine Beaubien 2020-06-21 02:26:00 -04:00 committed by GitHub
parent 0119cfd0d6
commit 0cf7880391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 11 deletions

View File

@ -14,6 +14,7 @@
"core-index/value": "Value",
"core-index/add-pref": "Add preference",
"core-index/pref-key": "Preference key value:",
"core-index/prefs-loading-failed": "Failed to load the preferences.",
"core-index/edit": "Edit",
"core-index/delete": "Delete",
"core-index/new-proj-name": "New project name:",

View File

@ -13,6 +13,7 @@
"core-index/version": "Version",
"core-index/error-rename": "Échec du renommage du projet :",
"core-index/pref-key": "Valeur de la préférence :",
"core-index/prefs-loading-failed": "La lecture des préférences na pas réussi.",
"core-index/change-metadata-value": "Changer la valeur de la clé de métadonnée",
"core-index/sample-data": "jeux de données d'exemple",
"core-index/description": "Description :",

View File

@ -71,19 +71,28 @@ Refine.postCSRF = function(url, data, success, dataType, failCallback) {
var lang = (navigator.language|| navigator.userLanguage).split("-")[0];
var dictionary = "";
$.ajax({
url : "command/core/load-language?",
type : "POST",
async : false,
data : {
module : "core",
//lang : lang
},
success : function(data) {
dictionary = data['dictionary'];
lang = data['lang'];
}
url : "command/core/load-language?",
type : "POST",
async : false,
data : {
module : "core",
//lang : lang
},
success : function(data) {
dictionary = data['dictionary'];
lang = data['lang'];
}
}).fail(function( jqXhr, textStatus, errorThrown ) {
var errorMessage = $.i18n('core-index/prefs-loading-failed');
if(errorMessage != "" && errorMessage != 'core-index/prefs-loading-failed') {
alert(errorMessage);
} else {
alert( textStatus + ':' + errorThrown );
}
});
$.i18n().load(dictionary, lang);
$.i18n().locale = lang;
//End internationalization
function deDupUserMetaData(arrObj) {