1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

various code improvements

This commit is contained in:
Pawel Spychalski (DzikuVx) 2016-11-29 23:10:09 +01:00
parent 706cb4c36f
commit b68f9a15c4
4 changed files with 440 additions and 484 deletions

View file

@ -9,28 +9,42 @@ function localize() {
return chrome.i18n.getMessage(messageID);
};
$('[i18n]:not(.i18n-replaced').each(function() {
$('[i18n]:not(.i18n-replaced)').each(function() {
var element = $(this);
element.html(translate(element.attr('i18n')));
element.addClass('i18n-replaced');
});
$('[i18n_title]:not(.i18n_title-replaced').each(function() {
$('[data-i18n]:not(.i18n-replaced)').each(function() {
var element = $(this);
element.html(translate(element.data('i18n')));
element.addClass('i18n-replaced');
});
$('[i18n_title]:not(.i18n_title-replaced)').each(function() {
var element = $(this);
element.attr('title', translate(element.attr('i18n_title')));
element.addClass('i18n_title-replaced');
});
$('[i18n_value]:not(.i18n_value-replaced').each(function() {
$('[data-i18n_title]:not(.i18n_title-replaced)').each(function() {
var element = $(this);
element.attr('title', translate(element.data('i18n_title')));
element.addClass('i18n_title-replaced');
});
$('[i18n_value]:not(.i18n_value-replaced)').each(function() {
var element = $(this);
element.val(translate(element.attr('i18n_value')));
element.addClass('i18n_value-replaced');
});
$('[i18n_placeholder]:not(.i18n_placeholder-replaced').each(function() {
$('[i18n_placeholder]:not(.i18n_placeholder-replaced)').each(function() {
var element = $(this);
element.attr('placeholder', translate(element.attr('i18n_placeholder')));