RandomSec/main/webapp/modules/core/scripts/index/lang-settings-ui.js
Tom Morris f4ff227340 Clean up localization - fixes #760, modifies pull request #755
- make all file loading relative to module base
- move core language files into appropriate place
- eliminate all SetLanguage commands and use SetPreference instead
- eliminate all LoadLanguage commands except for core's
- fix duplicate keys in JSON language files
- remove BOM from JSON language files

OPEN - task 760: Translations not being loaded from built kit 
http://github.com/OpenRefine/OpenRefine/issues/issue/760
2013-07-31 00:31:31 -04:00

37 lines
905 B
JavaScript

Refine.SetLanguageUI = function(elmt) {
var self = this;
elmt.html(DOM.loadHTML("core", "scripts/index/lang-settings-ui.html"));
this._elmt = elmt;
this._elmts = DOM.bind(elmt);
this._elmts.or_lang_label.text($.i18n._('core-index-lang')["label"]+":");
this._elmts.set_lan_btn.attr("value", $.i18n._('core-index-lang')["send-req"]);
this._elmts.set_lan_btn.bind('click', function(e) {
$.ajax({
url : "/command/core/set-preference?",
type : "POST",
async : false,
data : {
name : "userLang",
value : $("#langDD option:selected").val()
},
success : function(data) {
alert($.i18n._('core-index-lang')["page-reload"]);
location.reload(true);
}
});
});
};
Refine.SetLanguageUI.prototype.resize = function() {
};
Refine.actionAreas.push({
id : "lang-settings",
label : $.i18n._('core-index-lang')["lang-settings"],
uiClass : Refine.SetLanguageUI
});