2023-01-09 21:20:26 +01:00
|
|
|
import { ref } from 'vue'
|
2023-01-01 15:29:11 +01:00
|
|
|
|
2023-01-09 21:20:26 +01:00
|
|
|
interface LocaleObjectData {
|
|
|
|
code: string
|
|
|
|
name: string
|
|
|
|
dir?: 'ltr' | 'rtl'
|
2023-01-01 15:29:11 +01:00
|
|
|
}
|
|
|
|
|
2023-01-09 21:20:26 +01:00
|
|
|
export const defaultLocale = 'en-US'
|
|
|
|
|
|
|
|
export const locale = ref(defaultLocale)
|
|
|
|
|
|
|
|
export const locales: LocaleObjectData[] = [
|
2022-12-02 13:54:09 +01:00
|
|
|
{
|
|
|
|
code: 'en-US',
|
2022-12-28 07:50:26 +01:00
|
|
|
name: 'English (US)',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
code: 'en-GB',
|
|
|
|
name: 'English (UK)',
|
2022-12-02 13:54:09 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
code: 'de-DE',
|
|
|
|
name: 'Deutsch',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
code: 'zh-CN',
|
|
|
|
name: '简体中文',
|
|
|
|
},
|
2022-12-31 05:07:11 +01:00
|
|
|
{
|
|
|
|
code: 'zh-TW',
|
|
|
|
name: '繁体中文',
|
|
|
|
},
|
2022-12-02 13:54:09 +01:00
|
|
|
{
|
|
|
|
code: 'ja-JP',
|
|
|
|
name: '日本語',
|
|
|
|
},
|
2023-01-04 21:10:09 +01:00
|
|
|
{
|
|
|
|
code: 'nl-NL',
|
|
|
|
name: 'Nederlands',
|
|
|
|
},
|
2022-12-02 13:54:09 +01:00
|
|
|
{
|
|
|
|
code: 'es-ES',
|
|
|
|
name: 'Español',
|
|
|
|
},
|
2022-12-02 21:27:58 +01:00
|
|
|
{
|
|
|
|
code: 'fr-FR',
|
|
|
|
name: 'Français',
|
|
|
|
},
|
2023-01-08 20:35:48 +01:00
|
|
|
{
|
|
|
|
code: 'uk-UA',
|
|
|
|
name: 'Українська',
|
|
|
|
},
|
2022-12-14 22:19:38 +01:00
|
|
|
{
|
|
|
|
code: 'cs-CZ',
|
|
|
|
name: 'Česky',
|
2022-12-26 16:12:04 +01:00
|
|
|
},
|
2023-01-09 21:20:26 +01:00
|
|
|
{
|
2023-01-01 15:29:11 +01:00
|
|
|
code: 'ar-EG',
|
2022-12-26 16:12:04 +01:00
|
|
|
name: 'العربية',
|
2023-01-09 21:20:26 +01:00
|
|
|
dir: 'rtl' as const,
|
2022-12-02 13:54:09 +01:00
|
|
|
},
|
2023-01-09 21:20:26 +01:00
|
|
|
].sort((a, b) => a.code.localeCompare(b.code))
|