chore: update nuxt to 3.10.3 (#2610)
This commit is contained in:
parent
1fefb6e5b6
commit
55037f04cd
53 changed files with 3584 additions and 3766 deletions
|
@ -1,7 +1,5 @@
|
|||
import type { NuxtI18nOptions } from '@nuxtjs/i18n'
|
||||
import type { DateTimeFormats, NumberFormats, PluralizationRule, PluralizationRules } from '@intlify/core-base'
|
||||
|
||||
import type { LocaleObject } from '#i18n'
|
||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||
|
||||
interface LocaleObjectData extends LocaleObject {
|
||||
numberFormats?: NumberFormats
|
||||
|
@ -239,7 +237,7 @@ function buildLocales() {
|
|||
...data,
|
||||
code: l.code,
|
||||
name: l.name,
|
||||
files: [data.file!, `${l.code}.json`],
|
||||
files: [data.file as string, `${l.code}.json`],
|
||||
}
|
||||
delete entry.file
|
||||
acc.push(entry)
|
||||
|
@ -256,7 +254,7 @@ function buildLocales() {
|
|||
|
||||
export const currentLocales = buildLocales()
|
||||
|
||||
const datetimeFormats = Object.values(currentLocales).reduce((acc, data) => {
|
||||
export const datetimeFormats = Object.values(currentLocales).reduce((acc, data) => {
|
||||
const dateTimeFormats = data.dateTimeFormats
|
||||
if (dateTimeFormats) {
|
||||
acc[data.code] = { ...dateTimeFormats }
|
||||
|
@ -281,7 +279,7 @@ const datetimeFormats = Object.values(currentLocales).reduce((acc, data) => {
|
|||
return acc
|
||||
}, <DateTimeFormats>{})
|
||||
|
||||
const numberFormats = Object.values(currentLocales).reduce((acc, data) => {
|
||||
export const numberFormats = Object.values(currentLocales).reduce((acc, data) => {
|
||||
const numberFormats = data.numberFormats
|
||||
if (numberFormats) {
|
||||
acc[data.code] = { ...numberFormats }
|
||||
|
@ -313,7 +311,7 @@ const numberFormats = Object.values(currentLocales).reduce((acc, data) => {
|
|||
return acc
|
||||
}, <NumberFormats>{})
|
||||
|
||||
const pluralRules = Object.values(currentLocales).reduce((acc, data) => {
|
||||
export const pluralRules = Object.values(currentLocales).reduce((acc, data) => {
|
||||
const pluralRule = data.pluralRule
|
||||
if (pluralRule) {
|
||||
acc[data.code] = pluralRule
|
||||
|
@ -322,21 +320,3 @@ const pluralRules = Object.values(currentLocales).reduce((acc, data) => {
|
|||
|
||||
return acc
|
||||
}, <PluralizationRules>{})
|
||||
|
||||
export const i18n: NuxtI18nOptions = {
|
||||
locales: currentLocales,
|
||||
lazy: true,
|
||||
strategy: 'no_prefix',
|
||||
detectBrowserLanguage: false,
|
||||
langDir: 'locales',
|
||||
defaultLocale: 'en-US',
|
||||
vueI18n: {
|
||||
availableLocales: currentLocales.map(l => l.code),
|
||||
fallbackLocale: 'en-US',
|
||||
fallbackWarn: false,
|
||||
missingWarn: false,
|
||||
datetimeFormats,
|
||||
numberFormats,
|
||||
pluralRules,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue