migrate to lingui.config.ts to benefit from typing

This commit is contained in:
Athou
2024-08-03 22:24:59 +02:00
parent de80aa6bb3
commit 24666fd7fc
3 changed files with 53 additions and 53 deletions

View File

@@ -1,52 +0,0 @@
{
"locales": [
"ar",
"ca",
"cs",
"cy",
"da",
"de",
"en",
"es",
"fa",
"fi",
"fr",
"gl",
"hu",
"id",
"it",
"ja",
"ko",
"ms",
"nb",
"nl",
"nn",
"pl",
"pt",
"ru",
"sk",
"sv",
"tr",
"zh"
],
"catalogs": [
{
"path": "src/locales/{locale}/messages",
"include": [
"src"
],
"exclude": [
"src/locales/**"
]
}
],
"format": "po",
"formatOptions": {
"origins": true,
"lineNumbers": false
},
"sourceLocale": "en",
"fallbackLocales": {
"default": "en"
}
}

View File

@@ -0,0 +1,52 @@
import type { LinguiConfig } from "@lingui/conf"
const config: LinguiConfig = {
locales: [
"ar",
"ca",
"cs",
"cy",
"da",
"de",
"en",
"es",
"fa",
"fi",
"fr",
"gl",
"hu",
"id",
"it",
"ja",
"ko",
"ms",
"nb",
"nl",
"nn",
"pl",
"pt",
"ru",
"sk",
"sv",
"tr",
"zh",
],
catalogs: [
{
path: "src/locales/{locale}/messages",
include: ["src"],
exclude: ["src/locales/**"],
},
],
format: "po",
formatOptions: {
origins: true,
lineNumbers: false,
},
sourceLocale: "en",
fallbackLocales: {
default: "en",
},
}
export default config

View File

@@ -10,7 +10,7 @@ interface Locale {
}
// add an object to the array to add a new locale
// don't forget to also add it to the 'locales' array in .linguirc
// don't forget to also add it to the 'locales' array in lingui.config.ts
export const locales: Locale[] = [
{ key: "ar", label: "العربية", dayjsImportFn: async () => await import("dayjs/locale/ar") },
{ key: "ca", label: "Català", dayjsImportFn: async () => await import("dayjs/locale/ca") },