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
2 changed files with 6 additions and 2 deletions
Showing only changes of commit b30aea57ad - Show all commits
@@ -17,7 +17,7 @@ limitations under the License.
<script setup>
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { loadLanguage } from '@/i18n';
import { loadLanguage, LANGUAGES_RTL } from '@/i18n';
const { locale } = useI18n();
@@ -40,7 +40,7 @@ async function selectLanguage(code) {
await loadLanguage(code);
localStorage.setItem('locale', code);
document.documentElement.lang = code;
document.documentElement.dir = code === 'ar' ? 'rtl' : 'ltr';
document.documentElement.dir = LANGUAGES_RTL.includes(code) ? 'rtl' : 'ltr';
isOpen.value = false;
}
1
+4
View File
@@ -19,6 +19,10 @@ import getCurrentLanguage from './utils/currentLanguage';
export const fallbackLocale = 'en';
export const LANGUAGES_RTL = [
jakob.scheid marked this conversation as resolved Outdated
Outdated
Review

Not all of these languages are supported.

Not all of these languages are supported.
'ar'
];
const SUPPORTED_LANGUAGES = [
'en', 'de', 'fr', 'es', 'it', 'pt', 'zh', 'ja', 'ar', 'hi'
];