Fixed L10N JSON format

This commit is contained in:
squidfunk 2019-11-26 10:19:10 +01:00
parent b5ad4ac339
commit e1cab27714
2 changed files with 30 additions and 30 deletions

View File

@ -203,21 +203,21 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
<script id="__lang" type="application/json"> <script id="__lang" type="application/json">
{ {%- set translations = {} -%}
{% for key in [ {%- for key in [
"clipboard.copy", "clipboard.copy",
"clipboard.copied", "clipboard.copied",
"search.language", "search.language",
"search.pipeline.stopwords", "search.pipeline.stopwords",
"search.pipeline.trimmer", "search.pipeline.trimmer",
"search.result.none", "search.result.none",
"search.result.one", "search.result.one",
"search.result.other", "search.result.other",
"search.tokenizer" "search.tokenizer"
] -%} ] -%}
"{{ key }}": "{{ lang.t(key) }}"{{ "," if not loop.last }} {%- set _ = translations.update({ key: lang.t(key) }) -%}
{% endfor %} {%- endfor -%}
} {{ translations | tojson }}
</script> </script>
<script>app({version:"{{ mkdocs_version }}",url:{base:"{{ base_url }}"}})</script> <script>app({version:"{{ mkdocs_version }}",url:{base:"{{ base_url }}"}})</script>
{% for path in config["extra_javascript"] %} {% for path in config["extra_javascript"] %}

View File

@ -402,21 +402,21 @@
<!-- Translations --> <!-- Translations -->
<script id="__lang" type="application/json"> <script id="__lang" type="application/json">
{ {%- set translations = {} -%}
{% for key in [ {%- for key in [
"clipboard.copy", "clipboard.copy",
"clipboard.copied", "clipboard.copied",
"search.language", "search.language",
"search.pipeline.stopwords", "search.pipeline.stopwords",
"search.pipeline.trimmer", "search.pipeline.trimmer",
"search.result.none", "search.result.none",
"search.result.one", "search.result.one",
"search.result.other", "search.result.other",
"search.tokenizer" "search.tokenizer"
] -%} ] -%}
"{{ key }}": "{{ lang.t(key) }}"{{ "," if not loop.last }} {%- set _ = translations.update({ key: lang.t(key) }) -%}
{% endfor %} {%- endfor -%}
} {{ translations | tojson }}
</script> </script>
<script> <script>
app({ app({