From 69d3cd899ce4dc8da6d36c885c5c0d387eede92d Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Fri, 10 Nov 2023 09:29:52 +0100 Subject: [PATCH] feat(i18n): change location of translation files --- apps/client/src/libs/lingui.ts | 6 +++--- apps/client/src/locales/{de-DE.po => de-DE/messages.po} | 2 +- apps/client/src/locales/{en-US.po => en-US/messages.po} | 6 +++++- lingui.config.ts | 5 +++-- 4 files changed, 12 insertions(+), 7 deletions(-) rename apps/client/src/locales/{de-DE.po => de-DE/messages.po} (99%) rename apps/client/src/locales/{en-US.po => en-US/messages.po} (99%) diff --git a/apps/client/src/libs/lingui.ts b/apps/client/src/libs/lingui.ts index cf680e105..0812d4a5b 100644 --- a/apps/client/src/libs/lingui.ts +++ b/apps/client/src/libs/lingui.ts @@ -1,15 +1,15 @@ import { i18n } from "@lingui/core"; import { t } from "@lingui/macro"; +export const defaultLocale = "en-US"; + export const getLocales = () => ({ "en-US": t`English`, "de-DE": t`German`, }); -export const defaultLocale = "en-US"; - export async function dynamicActivate(locale: string) { - const { messages } = await import(`../locales/${locale}.po`); + const { messages } = await import(`../locales/${locale}/messages.po`); i18n.load(locale, messages); i18n.activate(locale); diff --git a/apps/client/src/locales/de-DE.po b/apps/client/src/locales/de-DE/messages.po similarity index 99% rename from apps/client/src/locales/de-DE.po rename to apps/client/src/locales/de-DE/messages.po index 5ff61abef..c445d62d3 100644 --- a/apps/client/src/locales/de-DE.po +++ b/apps/client/src/locales/de-DE/messages.po @@ -1,6 +1,6 @@ msgid "" msgstr "" -"POT-Creation-Date: 2023-11-10 08:58+0100\n" +"POT-Creation-Date: 2023-11-10 09:26+0100\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/apps/client/src/locales/en-US.po b/apps/client/src/locales/en-US/messages.po similarity index 99% rename from apps/client/src/locales/en-US.po rename to apps/client/src/locales/en-US/messages.po index a3194a3e7..54630755b 100644 --- a/apps/client/src/locales/en-US.po +++ b/apps/client/src/locales/en-US/messages.po @@ -1,6 +1,6 @@ msgid "" msgstr "" -"POT-Creation-Date: 2023-11-10 08:58+0100\n" +"POT-Creation-Date: 2023-11-10 09:26+0100\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -11,6 +11,10 @@ msgstr "" msgid "You have enabled two-factor authentication successfully." msgstr "You have enabled two-factor authentication successfully." +#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx:113 +msgid "{value, plural, one {Column} other {Columns}}" +msgstr "{value, plural, one {Column} other {Columns}}" + #: apps/client/src/pages/builder/sidebars/right/sections/information.tsx:20 msgid "<0>I built Reactive Resume mostly by myself during my spare time, with a lot of help from other great open-source contributors.<1>If you like the app and want to support keeping it free forever, please donate whatever you can afford to give.<2>Your donations could be tax-deductible, depending on your location." msgstr "<0>I built Reactive Resume mostly by myself during my spare time, with a lot of help from other great open-source contributors.<1>If you like the app and want to support keeping it free forever, please donate whatever you can afford to give.<2>Your donations could be tax-deductible, depending on your location." diff --git a/lingui.config.ts b/lingui.config.ts index 29507ee32..ebe7eec0b 100644 --- a/lingui.config.ts +++ b/lingui.config.ts @@ -1,11 +1,12 @@ import type { LinguiConfig } from "@lingui/conf"; const config: LinguiConfig = { - locales: ["en-US", "de-DE"], + format: "po", sourceLocale: "en-US", + locales: ["en-US", "de-DE"], catalogs: [ { - path: "/apps/client/src/locales/{locale}", + path: "/apps/client/src/locales/{locale}/messages", include: ["/apps/client/src"], }, ],