mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-08 20:10:17 +02:00
[FIX] Moment.JS Localisation
Load the right JS when our language code has 2 parts - fr_FR - it_IT - pl_PL And so on
This commit is contained in:
parent
7033406ba6
commit
d99f5858d8
@ -1,7 +1,19 @@
|
||||
{% load i18n %}
|
||||
|
||||
<!-- Start Moment.js from cdnjs -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js" integrity="sha512-+H4iLjY3JsKiF2V6N366in5IQHj2uEsGV7Pp/GRcm0fn76aPAk5V8xB6n8fQhhSonTqTXs/klFz4D0GIn6Br9g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
{% if locale and LANGUAGE_CODE != 'en' %}
|
||||
<!-- Moment.JS Not EN-en -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/locale/{{ LANGUAGE_CODE }}.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
{% get_language_info for LANGUAGE_CODE as lang %}
|
||||
|
||||
{% if lang.code == 'zh-hans' %}
|
||||
<!-- Moment.JS Localisation ({{ lang.code }}) -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/locale/zh-cn.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
{% else %}
|
||||
<!-- Moment.JS Localisation ({{ lang.code }}) -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/locale/{{ lang.code }}.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- End Moment JS from cdnjs -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user