1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

[i18n] Applying localization to elements with non-empty titles

This way links will display the correct tooltip when hovering them
This commit is contained in:
Alberto García Hierro 2020-01-29 21:58:01 +00:00
parent 7f130d95c4
commit c023b94166

View file

@ -19,8 +19,12 @@ function localize() {
$('[data-i18n]:not(.i18n-replaced)').each(function() {
var element = $(this);
element.html(translate(element.data('i18n')));
const translated = translate(element.data('i18n'));
element.html(translated);
element.addClass('i18n-replaced');
if (element.attr("title") !== "") {
element.attr("title", translated);
}
});
$('[i18n_title]:not(.i18n_title-replaced)').each(function() {
@ -52,4 +56,4 @@ function localize() {
});
return localized;
}
}