Add more Languages and switch button #70

Merged
jakob.scheid merged 22 commits from feature/add-languages into main 2026-05-22 17:19:25 +02:00
Member

Closes: #69

Closes: #69
johannes.vos added this to the mvp-frontend milestone 2026-05-20 20:36:36 +02:00
johannes.vos added the area/global
type
feature
prio
low
labels 2026-05-20 20:36:36 +02:00
johannes.vos self-assigned this 2026-05-20 20:36:36 +02:00
johannes.vos added this to the MVP Frontend project 2026-05-20 20:36:36 +02:00
johannes.vos added 8 commits 2026-05-20 20:36:36 +02:00
johannes.vos moved this to Review in MVP Frontend on 2026-05-20 20:36:59 +02:00
jakob.scheid reviewed 2026-05-21 13:12:21 +02:00
@@ -0,0 +23,4 @@
const isOpen = ref(false);
const languages = [
Owner

Please do not use hard-coded values. All strings should be in the locale files.

Please do not use hard-coded values. All strings should be in the locale files.
jakob.scheid marked this conversation as resolved
jakob.scheid reviewed 2026-05-21 13:13:16 +02:00
@@ -0,0 +36,4 @@
() => languages.find(l => l.code === locale.value) ?? languages[0]
);
async function selectLanguage(code) {
Owner

I think an extra function that simply calls another function is not necessary.

I think an extra function that simply calls another function is not necessary.
jakob.scheid marked this conversation as resolved
jakob.scheid reviewed 2026-05-21 13:14:09 +02:00
@@ -0,0 +49,4 @@
}
function closeOnBlur() {
// Kleines Delay damit Click auf Option noch registriert wird
Owner

I ask you to speak English.

I ask you to speak English.
jakob.scheid marked this conversation as resolved
Owner

Should we say „Sie“ or „Du“ in German?

Should we say „Sie“ or „Du“ in German?
jakob.scheid reviewed 2026-05-21 15:04:16 +02:00
jakob.scheid left a comment
Owner

I suggest naming the directory src/features/i18n//src/features/internationalization/src/features/locale_preferences.

I suggest naming the directory `src/features/i18n/`/`src/features/internationalization`/`src/features/locale_preferences`.
jakob.scheid reviewed 2026-05-21 15:06:12 +02:00
@@ -0,0 +40,4 @@
await loadLanguage(code);
localStorage.setItem('locale', code);
document.documentElement.lang = code;
document.documentElement.dir = code === 'ar' ? 'rtl' : 'ltr';
Owner

Consider that Arabic isn't the only language written from right to left.

Consider that Arabic isn't the only language written from right to left.
jakob.scheid marked this conversation as resolved
jakob.scheid requested changes 2026-05-21 15:09:19 +02:00
Dismissed
jakob.scheid left a comment
Owner

When you open the dropdown menu, select a language, and then click on it again, it closes immediately.

When you open the dropdown menu, select a language, and then click on it again, it closes immediately.
jakob.scheid reviewed 2026-05-21 15:39:56 +02:00
@@ -0,0 +24,4 @@
const isOpen = ref(false);
const languages = [
{ code: 'en', label: 'English', flag: '🇬🇧' },
Owner

You do not need lines const currentLanguage = … if you simply write

const languages = {
    'en': {
        label: 'English',
        flag: '🇬🇧'
    },
    …
}
You do not need lines `const currentLanguage = …` if you simply write ``` const languages = { 'en': { label: 'English', flag: '🇬🇧' }, … } ```
jakob.scheid marked this conversation as resolved
jakob.scheid added 1 commit 2026-05-21 15:45:30 +02:00
Owner

There is no error handling if a locale does not exist.

There is no error handling if a locale does not exist.
jakob.scheid added 1 commit 2026-05-21 21:57:44 +02:00
jakob.scheid added 1 commit 2026-05-21 22:00:03 +02:00
jakob.scheid reviewed 2026-05-21 22:02:02 +02:00
src/i18n.js Outdated
@@ -21,3 +21,3 @@
const SUPPORTED_LANGUAGES = [
'en'
'en', 'de', 'fr', 'es', 'it', 'pt', 'zh', 'ja', 'ar', 'hi'
Owner

Not all of these languages are supported.

Not all of these languages are supported.
jakob.scheid marked this conversation as resolved
jakob.scheid added 4 commits 2026-05-21 22:32:49 +02:00
jakob.scheid reviewed 2026-05-21 22:42:24 +02:00
jakob.scheid added 1 commit 2026-05-21 23:29:13 +02:00
jakob.scheid reviewed 2026-05-21 23:31:51 +02:00
@@ -0,0 +111,4 @@
border-radius: 6px;
padding: 4px 10px;
cursor: pointer;
font-size: 0.9rem;
Owner

Why did you do that?

Why did you do that?
jakob.scheid marked this conversation as resolved
jakob.scheid added 1 commit 2026-05-21 23:33:26 +02:00
jakob.scheid added 2 commits 2026-05-22 14:19:17 +02:00
jakob.scheid added 1 commit 2026-05-22 14:21:45 +02:00
jakob.scheid added 1 commit 2026-05-22 15:21:55 +02:00
jakob.scheid marked the pull request as work in progress 2026-05-22 15:53:51 +02:00
jakob.scheid added 1 commit 2026-05-22 17:18:34 +02:00
jakob.scheid marked the pull request as ready for review 2026-05-22 17:18:45 +02:00
jakob.scheid approved these changes 2026-05-22 17:19:13 +02:00
jakob.scheid merged commit 9aecc195a9 into main 2026-05-22 17:19:25 +02:00
jakob.scheid deleted branch feature/add-languages 2026-05-22 17:19:25 +02:00
jakob.scheid moved this to Done in MVP Frontend on 2026-05-22 17:25:16 +02:00
Sign in to join this conversation.