From 24666fd7fc509f7479b423ddbd3f1af3bbd68f4e Mon Sep 17 00:00:00 2001 From: Athou Date: Sat, 3 Aug 2024 22:24:59 +0200 Subject: [PATCH] migrate to lingui.config.ts to benefit from typing --- commafeed-client/.linguirc | 52 ------------------------------- commafeed-client/lingui.config.ts | 52 +++++++++++++++++++++++++++++++ commafeed-client/src/i18n.ts | 2 +- 3 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 commafeed-client/.linguirc create mode 100644 commafeed-client/lingui.config.ts diff --git a/commafeed-client/.linguirc b/commafeed-client/.linguirc deleted file mode 100644 index a27aabc1..00000000 --- a/commafeed-client/.linguirc +++ /dev/null @@ -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" - } -} diff --git a/commafeed-client/lingui.config.ts b/commafeed-client/lingui.config.ts new file mode 100644 index 00000000..71d8dd70 --- /dev/null +++ b/commafeed-client/lingui.config.ts @@ -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 diff --git a/commafeed-client/src/i18n.ts b/commafeed-client/src/i18n.ts index 7cf529ca..ff4d8e03 100644 --- a/commafeed-client/src/i18n.ts +++ b/commafeed-client/src/i18n.ts @@ -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") },