Skip to content

Commit

Permalink
Update i18n packages (#4876)
Browse files Browse the repository at this point in the history
* Update i18n packages

Signed-off-by: Olga Bulat <obulat@gmail.com>

* Remove intlify packages from dependencies

Signed-off-by: Olga Bulat <obulat@gmail.com>

* Replace iso with language

* Update the lock file

---------

Signed-off-by: Olga Bulat <obulat@gmail.com>
  • Loading branch information
obulat authored Sep 10, 2024
1 parent aea8a33 commit f542db3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 21 deletions.
4 changes: 2 additions & 2 deletions frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ export default defineNuxtConfig({
code: "en", // unique identifier for the locale in Vue i18n
dir: "ltr",
file: "en.json",
iso: "en", // used for SEO purposes (html lang attribute)
language: "en", // used for SEO purposes (html lang attribute)

/* Custom fields */

name: "English",
nativeName: "English",
},
...locales,
].filter((l) => Boolean(l.iso)) as LocaleObject[],
].filter((l) => Boolean(l.language)) as LocaleObject[],
lazy: true,
langDir: "locales",
defaultLocale: "en",
Expand Down
4 changes: 1 addition & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
},
"dependencies": {
"@floating-ui/dom": "^1.6.8",
"@intlify/core-base": "9.13.1",
"@intlify/message-compiler": "9.13.1",
"@nuxtjs/plausible": "^1.0.2",
"@nuxtjs/robots": "^4.0.2",
"@nuxtjs/sitemap": "^5.3.5",
Expand All @@ -89,7 +87,7 @@
"devDependencies": {
"@babel/parser": "^7.24.8",
"@nuxt/test-utils": "^3.14.1",
"@nuxtjs/i18n": "8.3.1",
"@nuxtjs/i18n": "8.5.2",
"@nuxtjs/storybook": "npm:@nuxtjs/storybook@nightly",
"@playwright/test": "1.46.1",
"@storybook-vue/nuxt": "npm:@storybook-vue/nuxt@nightly",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locales/scripts/get-validated-locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const getValidatedLocales = async () => {
// Check for a language in all three versions of the ISO 639 spec,
// defaulting to the v1 two-character codes before checking for the
// three-character codes in the v2 and v3 specs.
iso:
language:
locale.langCodeIso_639_1 ??
locale.langCodeIso_639_2 ??
locale.langCodeIso_639_3 ??
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locales/scripts/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface I18nLocaleProps {
name: string
wpLocale?: string
file?: string
iso?: string
language?: string
dir?: string
translated?: number
}
3 changes: 0 additions & 3 deletions frontend/test/locales/valid-locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"code": "ar",
"name": "Arabic",
"nativeName": "العربية",
"iso": "ar",
"language": "ar",
"wpLocale": "ar",
"dir": "rtl",
Expand All @@ -14,7 +13,6 @@
"code": "es",
"name": "Spanish (Spain)",
"nativeName": "Español",
"iso": "es",
"language": "es",
"wpLocale": "es_ES",
"dir": "ltr",
Expand All @@ -25,7 +23,6 @@
"code": "ru",
"name": "Russian",
"nativeName": "Русский",
"iso": "ru",
"language": "ru",
"wpLocale": "ru_RU",
"dir": "ltr",
Expand Down
16 changes: 5 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f542db3

Please sign in to comment.