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:
parent
7f130d95c4
commit
c023b94166
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue