fix(i18n): add missing translation keys (#2291) - #2294
Conversation
Hardcoded English leftovers in edit mode and section editor now use $t, with matching en/de keys. Preferred locale is applied before auth toasts so login.authenticated-redirecting resolves after a clean cache.
✅ Deploy Preview for dashy-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Only add locale strings for languages I can review myself. English keys and $t wiring stay; new UI strings go into tr.json instead of de.json.
eaaab02 to
a5326d0
Compare
|
Thanks for the heads-up — agreed on sticking to languages I can actually review. I dropped the new |
lissy93
left a comment
There was a problem hiding this comment.
Hey @AzazelSensei
Thanks for the PR.
But I don't think I can merge this, as the code quality is going to cause some maintainability issues in the future. And I think it missunderstands and over-complicates the issue.
There was a problem hiding this comment.
Actually, I don't think the original issue was actually this complicated, or anything to do with loading order. But the root cause was actually just that the translation key (login.authenticated-redirecting) was missing from the locale that OP was using.
If it was a loading issue, then English wouldn't have loaded either.
| }, | ||
| computed: { | ||
| allowViewConfig() { return this.$store.getters.permissions.allowViewConfig; }, | ||
| customSchema() { |
There was a problem hiding this comment.
I don't think this approach is good. The schema constantly changing, we cannot hard-code like this, as it will break in future updates.
There was a problem hiding this comment.
I think the original issue was just adding the missing keys to the modal header and stuff for the edit item menu. And this is missing from this PR, so don't think it solves the problem
The missing copy was in the edit-item modal, add-new tile, and edit-mode banner. Reverted the locale loader and schema field overrides. New keys only in en.json and tr.json.
|
Dropped the locale loader and the schema field overrides. The missing copy was the edit-item modal header / more-fields, the add-new tile, and the edit-mode banner. Those are wired now. Also added login.authenticated-redirecting in tr.json. |
|
I think this is what it should look like: #2296 Here's the full patch, it's actually pretty small: ---
src/assets/locales/en.json | 4 +++-
src/components/InteractiveEditor/EditModeTopBanner.vue | 2 +-
src/components/LinkItems/Section.vue | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json
index 772cf3d963..028533aceb 100644
--- a/src/assets/locales/en.json
+++ b/src/assets/locales/en.json
@@ -363,7 +363,9 @@
"save-locally-warning": "If you proceed, changes will be saved only in your browser. You should export a copy of your config for use on other machines. Would you like to continue?"
},
"edit-item": {
- "missing-title-err": "An item title is required"
+ "missing-title-err": "An item title is required",
+ "add-item-title": "Add New Item",
+ "add-item-description": "Click to add new item"
},
"edit-section": {
"edit-section-title": "Edit Section",
diff --git a/src/components/InteractiveEditor/EditModeTopBanner.vue b/src/components/InteractiveEditor/EditModeTopBanner.vue
index 4d7047c6bc..c69a8783b1 100644
--- a/src/components/InteractiveEditor/EditModeTopBanner.vue
+++ b/src/components/InteractiveEditor/EditModeTopBanner.vue
@@ -1,6 +1,6 @@
<template>
<div class="edit-mode-top-banner">
- <span>Edit Mode Enabled</span>
+ <span>{{ $t('interactive-editor.menu.edit-mode-subtitle') }}</span>
</div>
</template>
diff --git a/src/components/LinkItems/Section.vue b/src/components/LinkItems/Section.vue
index 0eabf9c047..7f50ba55f3 100644
--- a/src/components/LinkItems/Section.vue
+++ b/src/components/LinkItems/Section.vue
@@ -48,8 +48,8 @@
<Item v-if="isEditMode"
:item="{
icon: ':heavy_plus_sign:',
- title: 'Add New Item',
- description: 'Click to add new item',
+ title: $t('interactive-editor.edit-item.add-item-title'),
+ description: $t('interactive-editor.edit-item.add-item-description'),
id: 'add-new',
}"
:isAddNew="true" |
|
Got it - #2296 is the smaller change. I can close this. |
Category
Localization
Overview
Wires hardcoded English leftovers in edit mode / section editor through
$t(...), adds matching keys inen.jsonandde.json, and loads the preferred locale before auth toasts sologin.authenticated-redirectingresolves with language=de after a clean cache.Keys / UI fixed
interactive-editor.menu.edit-mode-enabled— edit-mode top bannerinteractive-editor.edit-item.add-new-title/add-new-description— add-item tileinteractive-editor.edit-section.fields.*— section form labels/descriptions (name,icon,displayData,sortBy,rows,cols,collapsed,hideForGuests)login.authenticated-redirecting— existing key; applied via early locale load before OIDC/Keycloak toastIssue Number
Fixes #2291
Additional Info
How to verify
de) and hard-refresh / clear cacheauthenticated-redirectingstring