mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-29 11:20:36 +01:00
docs(i18n): auto generated lang support (#2574)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
35
docs/app/components/content/SupportedLanguages.vue
Normal file
35
docs/app/components/content/SupportedLanguages.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import * as locales from '@nuxt/ui/locale'
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<{
|
||||||
|
default?: string
|
||||||
|
}>(), {
|
||||||
|
default: 'en'
|
||||||
|
})
|
||||||
|
|
||||||
|
const getLocaleKeys = () => Object.keys(locales) as Array<keyof typeof locales>
|
||||||
|
const localesList = getLocaleKeys().map(locale => [locale, locales[locale].name])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<ProseUl>
|
||||||
|
<ProseLi v-for="[key, label] in localesList" :key="key">
|
||||||
|
<ProseCode>{{ key }}</ProseCode> - {{ label }}
|
||||||
|
<template v-if="key === props.default">
|
||||||
|
(default)
|
||||||
|
</template>
|
||||||
|
</ProseLi>
|
||||||
|
</ProseUl>
|
||||||
|
<ProseP>
|
||||||
|
If you need any other languages, a
|
||||||
|
<ProseA href="https://github.com/nuxt/ui/pulls" target="_blank">
|
||||||
|
PR
|
||||||
|
</ProseA>
|
||||||
|
is always welcome, you only need to add a language file
|
||||||
|
<ProseA href="https://github.com/nuxt/ui/tree/v3/src/runtime/locale" target="_blank">
|
||||||
|
here
|
||||||
|
</ProseA>
|
||||||
|
</ProseP>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -172,10 +172,4 @@ const dir = computed(() => textDirection.value === 'rtl' ? 'rtl' : 'ltr')
|
|||||||
|
|
||||||
## Supported languages
|
## Supported languages
|
||||||
|
|
||||||
<!-- TODO: add auto generating language list https://github.com/nuxt/ui/issues/2565 -->
|
:supported-languages
|
||||||
* `de` - Deutsch
|
|
||||||
* `en` - English (default)
|
|
||||||
* `fr` - Français
|
|
||||||
* `ru` - Русский
|
|
||||||
|
|
||||||
If you need any other languages, a [PR](https://github.com/nuxt/ui/pulls) is always welcome, you only need to add a language file [here](https://github.com/nuxt/ui/tree/v3/src/runtime/locale).
|
|
||||||
|
|||||||
@@ -181,10 +181,4 @@ const dir = computed(() => textDirection.value === 'rtl' ? 'rtl' : 'ltr')
|
|||||||
|
|
||||||
## Supported languages
|
## Supported languages
|
||||||
|
|
||||||
<!-- TODO: add auto generating language list https://github.com/nuxt/ui/issues/2565 -->
|
:supported-languages
|
||||||
* `de` - Deutsch
|
|
||||||
* `en` - English (default)
|
|
||||||
* `fr` - Français
|
|
||||||
* `ru` - Русский
|
|
||||||
|
|
||||||
If you need any other languages, a [PR](https://github.com/nuxt/ui/pulls) is always welcome, you only need to add a language file [here](https://github.com/nuxt/ui/tree/v3/src/runtime/locale).
|
|
||||||
|
|||||||
Reference in New Issue
Block a user