Skip to content

Commit

Permalink
feat(i18n): change location of translation files
Browse files Browse the repository at this point in the history
  • Loading branch information
AmruthPillai committed Nov 10, 2023
1 parent c52a0d4 commit 69d3cd8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions apps/client/src/libs/lingui.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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.</0><1>If you like the app and want to support keeping it free forever, please donate whatever you can afford to give.</1><2>Your donations could be tax-deductible, depending on your location.</2>"
msgstr "<0>I built Reactive Resume mostly by myself during my spare time, with a lot of help from other great open-source contributors.</0><1>If you like the app and want to support keeping it free forever, please donate whatever you can afford to give.</1><2>Your donations could be tax-deductible, depending on your location.</2>"
Expand Down
5 changes: 3 additions & 2 deletions lingui.config.ts
Original file line number Diff line number Diff line change
@@ -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: "<rootDir>/apps/client/src/locales/{locale}",
path: "<rootDir>/apps/client/src/locales/{locale}/messages",
include: ["<rootDir>/apps/client/src"],
},
],
Expand Down

0 comments on commit 69d3cd8

Please sign in to comment.