feat(i18n): add pt-br as selectable language in the frontend
This commit is contained in:
parent
2c5f8126c5
commit
28d72d4d47
@ -21,6 +21,7 @@ export const SUPPORTED_LOCALES = {
|
|||||||
'hu-HU': 'Magyar',
|
'hu-HU': 'Magyar',
|
||||||
'ar-SA': 'اَلْعَرَبِيَّةُ',
|
'ar-SA': 'اَلْعَرَبِيَّةُ',
|
||||||
'sl-SI': 'Slovenščina',
|
'sl-SI': 'Slovenščina',
|
||||||
|
'pt-BR': 'Português Brasileiro',
|
||||||
// IMPORTANT: Also add new languages to useDayjsLanguageSync
|
// IMPORTANT: Also add new languages to useDayjsLanguageSync
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import {computed, ref, watch} from 'vue'
|
import {computed, ref, watch} from 'vue'
|
||||||
import type dayjs from 'dayjs'
|
import type dayjs from 'dayjs'
|
||||||
|
|
||||||
import {i18n, type SupportedLocale, type ISOLanguage} from '@/i18n'
|
import {i18n, type ISOLanguage, type SupportedLocale} from '@/i18n'
|
||||||
|
|
||||||
export const DAYJS_LOCALE_MAPPING = {
|
export const DAYJS_LOCALE_MAPPING = {
|
||||||
'de-de': 'de',
|
'de-de': 'de',
|
||||||
@ -22,6 +22,7 @@ export const DAYJS_LOCALE_MAPPING = {
|
|||||||
'hu-HU': 'hu',
|
'hu-HU': 'hu',
|
||||||
'ar-SA': 'ar-sa',
|
'ar-SA': 'ar-sa',
|
||||||
'sl-SI': 'sl',
|
'sl-SI': 'sl',
|
||||||
|
'pt-BR': 'pt',
|
||||||
} as Record<SupportedLocale, ISOLanguage>
|
} as Record<SupportedLocale, ISOLanguage>
|
||||||
|
|
||||||
export const DAYJS_LANGUAGE_IMPORTS = {
|
export const DAYJS_LANGUAGE_IMPORTS = {
|
||||||
@ -36,13 +37,14 @@ export const DAYJS_LANGUAGE_IMPORTS = {
|
|||||||
'nl-nl': () => import('dayjs/locale/nl'),
|
'nl-nl': () => import('dayjs/locale/nl'),
|
||||||
'pt-pt': () => import('dayjs/locale/pt'),
|
'pt-pt': () => import('dayjs/locale/pt'),
|
||||||
'zh-cn': () => import('dayjs/locale/zh-cn'),
|
'zh-cn': () => import('dayjs/locale/zh-cn'),
|
||||||
'no-no': () => import('dayjs/locale/nn'),
|
'no-no': () => import('dayjs/locale/nn'),
|
||||||
'es-es': () => import('dayjs/locale/es'),
|
'es-es': () => import('dayjs/locale/es'),
|
||||||
'da-dk': () => import('dayjs/locale/da'),
|
'da-dk': () => import('dayjs/locale/da'),
|
||||||
'ja-jp': () => import('dayjs/locale/ja'),
|
'ja-jp': () => import('dayjs/locale/ja'),
|
||||||
'hu-hu': () => import('dayjs/locale/hu'),
|
'hu-hu': () => import('dayjs/locale/hu'),
|
||||||
'ar-sa': () => import('dayjs/locale/ar-sa'),
|
'ar-sa': () => import('dayjs/locale/ar-sa'),
|
||||||
'sl-si': () => import('dayjs/locale/sl'),
|
'sl-si': () => import('dayjs/locale/sl'),
|
||||||
|
'pt-br': () => import('dayjs/locale/pt-br'),
|
||||||
} as Record<SupportedLocale, () => Promise<ILocale>>
|
} as Record<SupportedLocale, () => Promise<ILocale>>
|
||||||
|
|
||||||
export function useDayjsLanguageSync(dayjsGlobal: typeof dayjs) {
|
export function useDayjsLanguageSync(dayjsGlobal: typeof dayjs) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user