fixed frontend localization

This commit is contained in:
vabene1111 2021-05-30 17:12:59 +02:00
parent e05019d2b1
commit 4f09970130
9 changed files with 13 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -25,6 +25,7 @@
<script type="application/javascript">
window.IMPORT_ID = {{pk}};
window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}'
</script>
{% render_bundle 'import_response_view' %}

View File

@ -61,6 +61,8 @@
<script type="application/javascript">
window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}'
window.RECIPE_ID = {{recipe.pk}};
window.USER_SERVINGS = {{ user_servings }};
window.SHARE_UID = '{{ share }}';

View File

@ -25,6 +25,8 @@
<script type="application/javascript">
window.IMAGE_PLACEHOLDER = "{% static 'assets/recipe_no_image.svg' %}"
window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}'
</script>
{% render_bundle 'recipe_search_view' %}

View File

@ -86,7 +86,7 @@ export default {
},
mounted() {
this.refreshData()
this.$i18n.locale = window.CUSTOM_LOCALE
setInterval(() => {
if ((this.import_id !== null) && window.navigator.onLine && this.import_info.running) {
this.refreshData()

View File

@ -34,7 +34,7 @@
</div>
<div class="col-md-3" style="margin-top: 1vh">
<a class="btn btn-primary btn-block text-uppercase"
:href="resolveDjangoUrl('data_import_url')">{{ $t('Url_Import') }}</a>
:href="resolveDjangoUrl('data_import_url')">{{ $t('Import') }}</a>
</div>
<div class="col-md-3" style="margin-top: 1vh">
<button class="btn btn-primary btn-block text-uppercase" @click="resetSearch">
@ -281,6 +281,8 @@ export default {
})
this.refreshData()
this.$i18n.locale = window.CUSTOM_LOCALE
},
watch: {
settings: {

View File

@ -196,6 +196,7 @@ export default {
},
mounted() {
this.loadRecipe(window.RECIPE_ID)
this.$i18n.locale = window.CUSTOM_LOCALE
},
methods: {
loadRecipe: function (recipe_id) {