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