Bug 24661: Fix inclusion of locale-related javascript files

2 js files (Gettext.js, i18n.js) + 1 generated js file (locale_data.js)
were added by bug 21156. Their URL are broken and the files are not loaded.

Use Template::Toolkit plugin Asset to include these files, and exclude
locale_data.js when language is english, because obviously translations
are not needed in this case.

Test plan:
1. Just make sure the files mentioned above are loaded correctly when in
   English and in other languages as well

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Julian Maurice 2020-02-14 09:46:01 +01:00 committed by Martin Renvoize
parent 97b84b631f
commit d2e60c553b
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 5 additions and 3 deletions

View File

@ -26,9 +26,11 @@
var Koha = {};
</script>
<script src="[% themelang | url %]/js/locale_data.js"></script>
<script src="[% interface | url %]/js/Gettext.js"></script>
<script src="[% interface | url %]/js/i18n.js"></script>
[% IF lang != 'en' %]
[% Asset.js(lang _ '/js/locale_data.js') | $raw %]
[% END %]
[% Asset.js('js/Gettext.js') | $raw %]
[% Asset.js('js/i18n.js') | $raw %]
[% IF ( login ) %]
[% Asset.css("css/login.css") | $raw %]