-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental testing of translated languages, must be manually enabled
- Loading branch information
1 parent
e3d0b30
commit 5841baf
Showing
3 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import enUS from "./lang/en-US.json" | ||
import ruRU from "./lang/ru.json" | ||
import deDE from "./lang/de.json" | ||
import esES from "./lang/es-ES.json" | ||
import noNO from "./lang/no.json" | ||
import ptBR from "./lang/pt-BR.json" | ||
|
||
export default defineI18nConfig(() => ({ | ||
legacy: false, | ||
fallbackLocale: "en", | ||
locale: "en", | ||
messages: { | ||
en: enUS, | ||
ru: ruRU, | ||
de: deDE, | ||
"es-ES": esES, | ||
"no-NO": noNO, | ||
"pt-BR": ptBR, | ||
}, | ||
strategy: "no_prefix", | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<div class="flex flex-col gap-8"> | ||
<PageHero | ||
:title="'Experimental Features'" | ||
:sub-title="'For development purposes'" | ||
/> | ||
|
||
<div class="flex flex-col gap-2"> | ||
<span class="font-bold text-lg"> | ||
Language switcher (for testing purposes) | ||
</span> | ||
|
||
Current Locale: | ||
|
||
{{ locale }} | ||
|
||
<br /><br /> | ||
|
||
Available alternative langagues: | ||
|
||
<a | ||
class="indent-4" | ||
href="#" | ||
v-for="locale in availableLocales" | ||
:key="locale.code" | ||
@click.prevent.stop="setLocale(locale.code)" | ||
> | ||
<span>- {{ locale.name }}</span> | ||
</a> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
const { locale, locales, setLocale } = useI18n() | ||
const availableLocales = computed(() => { | ||
return locales.value.filter((i) => i.code !== locale.value) | ||
}) | ||
</script> |