chore(i18n): update zu-ZA translations

This commit is contained in:
Amruth Pillai
2023-11-10 11:22:19 +01:00
parent 1057d390da
commit f3ad994753
19 changed files with 1666 additions and 135 deletions

View File

@ -40,7 +40,9 @@
<!-- Scripts -->
<script type="module" src="/src/main.tsx"></script>
<!-- Phosphor Icons -->
<script src="https://unpkg.com/@phosphor-icons/web"></script>
<!-- Crowdin Anonymous Translations -->
<script type="text/javascript" src="https://crowdin.com/js/crowdjet/crowdjet.js"></script>
<div id="crowdjet-container" data-project-id="503410" style="bottom: 90px; right: 20px"></div>
<div id="crowdjet-expand-container" style="bottom: 10px; right: 20px"></div>
</body>
</html>

View File

@ -1,12 +1,23 @@
import { i18n } from "@lingui/core";
import { t } from "@lingui/macro";
type Locale = "en-US" | "de-DE" | "zu-ZA";
export const defaultLocale = "en-US";
export const getLocales = () => ({
"en-US": t`English`,
"de-DE": t`German`,
});
export const getLocales = () => {
const locales = {
"en-US": t`English`,
"de-DE": t`German`,
} as Record<Locale, string>;
if (process.env.NODE_ENV === "development") {
// eslint-disable-next-line lingui/no-unlocalized-strings
locales["zu-ZA"] = "Pseudolocalization";
}
return locales;
};
export async function dynamicActivate(locale: string) {
const { messages } = await import(`../locales/${locale}/messages.po`);

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2023-11-10 09:26+0100\n"
"POT-Creation-Date: 2023-11-10 11:19+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -40,6 +40,7 @@ msgid "<0>Two-factor authentication is enabled.</0> You will be asked to enter a
msgstr ""
#: apps/client/src/pages/home/page.tsx:12
#: apps/client/src/pages/home/sections/hero/index.tsx:35
msgid "A free and open-source resume builder"
msgstr ""
@ -48,10 +49,6 @@ msgstr ""
msgid "A free and open-source resume builder that simplifies the process of creating, updating, and sharing your resume."
msgstr ""
#: apps/client/src/pages/home/sections/hero/index.tsx:35
msgid "A free and open-source resume builder."
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/sharing.tsx:29
msgid "A link has been copied to your clipboard."
msgstr ""
@ -81,6 +78,12 @@ msgstr ""
msgid "Add a custom field"
msgstr ""
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:108
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:147
msgctxt "For example, add a new work experience, or add a new profile."
msgid "Add a new item"
msgstr ""
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx:67
msgid "Add a new item"
msgstr ""
@ -90,12 +93,6 @@ msgstr ""
msgid "Add a new section"
msgstr ""
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:108
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:147
msgctxt "For example, add a new work experience, or add a new profile."
msgid "Add New Item"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/layout.tsx:267
msgid "Add New Page"
msgstr ""
@ -422,7 +419,7 @@ msgid "Don't know where to begin? Hit the docs!"
msgstr ""
#: apps/client/src/pages/dashboard/settings/_sections/profile.tsx:107
msgid "Don't see your locale? <0>Help translate the app.</0>"
msgid "Don't see your language? <0>Help translate the app.</0>"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/information.tsx:41
@ -481,7 +478,7 @@ msgstr ""
msgid "Enable 2FA"
msgstr ""
#: apps/client/src/libs/lingui.ts:5
#: apps/client/src/libs/lingui.ts:10
msgid "English"
msgstr ""
@ -509,7 +506,7 @@ msgstr ""
msgid "Errors"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:79
#: apps/client/src/pages/builder/sidebars/right/index.tsx:82
#: apps/client/src/pages/builder/sidebars/right/sections/export.tsx:40
msgid "Export"
msgstr ""
@ -538,19 +535,19 @@ msgstr ""
msgid "Fluency (CEFR)"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:95
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:94
msgid "Font Family"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:136
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:135
msgid "Font Size"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:110
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:109
msgid "Font Subset"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:122
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:121
msgid "Font Variants"
msgstr ""
@ -592,7 +589,7 @@ msgstr ""
msgid "Generate a random title for your resume"
msgstr ""
#: apps/client/src/libs/lingui.ts:6
#: apps/client/src/libs/lingui.ts:11
msgid "German"
msgstr ""
@ -697,7 +694,7 @@ msgstr ""
msgid "In this section, you can delete your account and all the data associated to your user, but please keep in mind that <0>this action is irreversible</0>."
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:83
#: apps/client/src/pages/builder/sidebars/right/index.tsx:86
#: apps/client/src/pages/builder/sidebars/right/sections/information.tsx:123
msgid "Information"
msgstr ""
@ -740,6 +737,7 @@ msgstr ""
msgid "Label"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/locale.tsx:42
#: apps/client/src/pages/dashboard/settings/_sections/profile.tsx:93
msgid "Language"
msgstr ""
@ -749,7 +747,7 @@ msgstr ""
msgid "Last updated {lastUpdated}"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:65
#: apps/client/src/pages/builder/sidebars/right/index.tsx:68
#: apps/client/src/pages/builder/sidebars/right/sections/layout.tsx:207
msgid "Layout"
msgstr ""
@ -774,7 +772,7 @@ msgstr ""
msgid "Light"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:153
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:152
msgid "Line Height"
msgstr ""
@ -787,6 +785,10 @@ msgstr ""
msgid "List"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/locale.tsx:36
msgid "Locale"
msgstr ""
#: apps/client/src/pages/builder/sidebars/left/dialogs/custom-section.tsx:95
#: apps/client/src/pages/builder/sidebars/left/dialogs/experience.tsx:86
#: apps/client/src/pages/builder/sidebars/left/dialogs/volunteer.tsx:81
@ -864,7 +866,7 @@ msgstr ""
msgid "Note: This will make your account less secure."
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:80
#: apps/client/src/pages/builder/sidebars/right/index.tsx:83
#: apps/client/src/pages/builder/sidebars/right/sections/notes.tsx:17
msgid "Notes"
msgstr ""
@ -894,7 +896,7 @@ msgid "OpenAI Integration"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/page.tsx:67
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:170
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:169
msgid "Options"
msgstr ""
@ -907,7 +909,7 @@ msgstr ""
msgid "Organization"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:72
#: apps/client/src/pages/builder/sidebars/right/index.tsx:75
#: apps/client/src/pages/builder/sidebars/right/sections/page.tsx:26
msgid "Page"
msgstr ""
@ -1081,15 +1083,15 @@ msgstr ""
msgid "Score"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:99
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:98
msgid "Search for a font family"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:114
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:113
msgid "Search for a font subset"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:127
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:126
msgid "Search for a font variant"
msgstr ""
@ -1116,7 +1118,7 @@ msgstr ""
msgid "Setup two-factor authentication on your account"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:73
#: apps/client/src/pages/builder/sidebars/right/index.tsx:76
#: apps/client/src/pages/builder/sidebars/right/sections/sharing.tsx:39
msgid "Sharing"
msgstr ""
@ -1180,7 +1182,7 @@ msgstr ""
msgid "Start from scratch"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:76
#: apps/client/src/pages/builder/sidebars/right/index.tsx:79
#: apps/client/src/pages/builder/sidebars/right/sections/statistics.tsx:23
msgid "Statistics"
msgstr ""
@ -1221,7 +1223,7 @@ msgstr ""
msgid "System"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:62
#: apps/client/src/pages/builder/sidebars/right/index.tsx:65
#: apps/client/src/pages/builder/sidebars/right/sections/template.tsx:18
msgid "Template"
msgstr ""
@ -1242,7 +1244,7 @@ msgstr ""
msgid "The resume you were looking for doesn't seem to exist, please check the link and try again."
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:71
#: apps/client/src/pages/builder/sidebars/right/index.tsx:74
#: apps/client/src/pages/builder/sidebars/right/sections/theme.tsx:20
#: apps/client/src/pages/dashboard/settings/_sections/profile.tsx:71
msgid "Theme"
@ -1303,12 +1305,12 @@ msgstr ""
msgid "Type of Study"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/index.tsx:68
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:67
#: apps/client/src/pages/builder/sidebars/right/index.tsx:71
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:66
msgid "Typography"
msgstr ""
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:181
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:180
msgid "Underline Links"
msgstr ""

View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2023-11-10 09:26+0100\n"
"POT-Creation-Date: 2023-11-10 11:19+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -40,6 +40,7 @@ msgid "<0>Two-factor authentication is enabled.</0> You will be asked to enter a
msgstr "<0>Two-factor authentication is enabled.</0> You will be asked to enter a code every time you sign in."
#: apps/client/src/pages/home/page.tsx:12
#: apps/client/src/pages/home/sections/hero/index.tsx:35
msgid "A free and open-source resume builder"
msgstr "A free and open-source resume builder"
@ -48,10 +49,6 @@ msgstr "A free and open-source resume builder"
msgid "A free and open-source resume builder that simplifies the process of creating, updating, and sharing your resume."
msgstr "A free and open-source resume builder that simplifies the process of creating, updating, and sharing your resume."
#: apps/client/src/pages/home/sections/hero/index.tsx:35
msgid "A free and open-source resume builder."
msgstr "A free and open-source resume builder."
#: apps/client/src/pages/builder/sidebars/right/sections/sharing.tsx:29
msgid "A link has been copied to your clipboard."
msgstr "A link has been copied to your clipboard."
@ -81,6 +78,12 @@ msgstr "Account"
msgid "Add a custom field"
msgstr "Add a custom field"
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:108
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:147
msgctxt "For example, add a new work experience, or add a new profile."
msgid "Add a new item"
msgstr "Add a new item"
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx:67
msgid "Add a new item"
msgstr "Add a new item"
@ -90,12 +93,6 @@ msgstr "Add a new item"
msgid "Add a new section"
msgstr "Add a new section"
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:108
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:147
msgctxt "For example, add a new work experience, or add a new profile."
msgid "Add New Item"
msgstr "Add New Item"
#: apps/client/src/pages/builder/sidebars/right/sections/layout.tsx:267
msgid "Add New Page"
msgstr "Add New Page"
@ -422,8 +419,8 @@ msgid "Don't know where to begin? Hit the docs!"
msgstr "Don't know where to begin? Hit the docs!"
#: apps/client/src/pages/dashboard/settings/_sections/profile.tsx:107
msgid "Don't see your locale? <0>Help translate the app.</0>"
msgstr "Don't see your locale? <0>Help translate the app.</0>"
msgid "Don't see your language? <0>Help translate the app.</0>"
msgstr "Don't see your language? <0>Help translate the app.</0>"
#: apps/client/src/pages/builder/sidebars/right/sections/information.tsx:41
msgid "Donate to Reactive Resume"
@ -481,7 +478,7 @@ msgstr "Email"
msgid "Enable 2FA"
msgstr "Enable 2FA"
#: apps/client/src/libs/lingui.ts:5
#: apps/client/src/libs/lingui.ts:10
msgid "English"
msgstr "English"
@ -509,7 +506,7 @@ msgstr "Enter your email address and we will send you a link to reset your passw
msgid "Errors"
msgstr "Errors"
#: apps/client/src/pages/builder/sidebars/right/index.tsx:79
#: apps/client/src/pages/builder/sidebars/right/index.tsx:82
#: apps/client/src/pages/builder/sidebars/right/sections/export.tsx:40
msgid "Export"
msgstr "Export"
@ -538,19 +535,19 @@ msgstr "Fluency"
msgid "Fluency (CEFR)"
msgstr "Fluency (CEFR)"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:95
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:94
msgid "Font Family"
msgstr "Font Family"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:136
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:135
msgid "Font Size"
msgstr "Font Size"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:110
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:109
msgid "Font Subset"
msgstr "Font Subset"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:122
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:121
msgid "Font Variants"
msgstr "Font Variants"
@ -592,7 +589,7 @@ msgstr "Full Name"
msgid "Generate a random title for your resume"
msgstr "Generate a random title for your resume"
#: apps/client/src/libs/lingui.ts:6
#: apps/client/src/libs/lingui.ts:11
msgid "German"
msgstr "German"
@ -697,7 +694,7 @@ msgstr "In this section, you can change your password and enable/disable two-fac
msgid "In this section, you can delete your account and all the data associated to your user, but please keep in mind that <0>this action is irreversible</0>."
msgstr "In this section, you can delete your account and all the data associated to your user, but please keep in mind that <0>this action is irreversible</0>."
#: apps/client/src/pages/builder/sidebars/right/index.tsx:83
#: apps/client/src/pages/builder/sidebars/right/index.tsx:86
#: apps/client/src/pages/builder/sidebars/right/sections/information.tsx:123
msgid "Information"
msgstr "Information"
@ -740,6 +737,7 @@ msgstr "Keywords"
msgid "Label"
msgstr "Label"
#: apps/client/src/pages/builder/sidebars/right/sections/locale.tsx:42
#: apps/client/src/pages/dashboard/settings/_sections/profile.tsx:93
msgid "Language"
msgstr "Language"
@ -749,7 +747,7 @@ msgstr "Language"
msgid "Last updated {lastUpdated}"
msgstr "Last updated {lastUpdated}"
#: apps/client/src/pages/builder/sidebars/right/index.tsx:65
#: apps/client/src/pages/builder/sidebars/right/index.tsx:68
#: apps/client/src/pages/builder/sidebars/right/sections/layout.tsx:207
msgid "Layout"
msgstr "Layout"
@ -774,7 +772,7 @@ msgstr "Licensed under <0>MIT</0>"
msgid "Light"
msgstr "Light"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:153
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:152
msgid "Line Height"
msgstr "Line Height"
@ -787,6 +785,10 @@ msgstr "LinkedIn, JSON Resume, etc."
msgid "List"
msgstr "List"
#: apps/client/src/pages/builder/sidebars/right/sections/locale.tsx:36
msgid "Locale"
msgstr "Locale"
#: apps/client/src/pages/builder/sidebars/left/dialogs/custom-section.tsx:95
#: apps/client/src/pages/builder/sidebars/left/dialogs/experience.tsx:86
#: apps/client/src/pages/builder/sidebars/left/dialogs/volunteer.tsx:81
@ -864,7 +866,7 @@ msgstr "New Password"
msgid "Note: This will make your account less secure."
msgstr "Note: This will make your account less secure."
#: apps/client/src/pages/builder/sidebars/right/index.tsx:80
#: apps/client/src/pages/builder/sidebars/right/index.tsx:83
#: apps/client/src/pages/builder/sidebars/right/sections/notes.tsx:17
msgid "Notes"
msgstr "Notes"
@ -894,7 +896,7 @@ msgid "OpenAI Integration"
msgstr "OpenAI Integration"
#: apps/client/src/pages/builder/sidebars/right/sections/page.tsx:67
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:170
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:169
msgid "Options"
msgstr "Options"
@ -907,7 +909,7 @@ msgstr "or continue with"
msgid "Organization"
msgstr "Organization"
#: apps/client/src/pages/builder/sidebars/right/index.tsx:72
#: apps/client/src/pages/builder/sidebars/right/index.tsx:75
#: apps/client/src/pages/builder/sidebars/right/sections/page.tsx:26
msgid "Page"
msgstr "Page"
@ -1081,15 +1083,15 @@ msgstr "Scan the QR code below with your authenticator app to setup 2FA on your
msgid "Score"
msgstr "Score"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:99
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:98
msgid "Search for a font family"
msgstr "Search for a font family"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:114
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:113
msgid "Search for a font subset"
msgstr "Search for a font subset"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:127
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:126
msgid "Search for a font variant"
msgstr "Search for a font variant"
@ -1116,7 +1118,7 @@ msgstr "Settings"
msgid "Setup two-factor authentication on your account"
msgstr "Setup two-factor authentication on your account"
#: apps/client/src/pages/builder/sidebars/right/index.tsx:73
#: apps/client/src/pages/builder/sidebars/right/index.tsx:76
#: apps/client/src/pages/builder/sidebars/right/sections/sharing.tsx:39
msgid "Sharing"
msgstr "Sharing"
@ -1180,7 +1182,7 @@ msgstr "Start building your resume by giving it a name."
msgid "Start from scratch"
msgstr "Start from scratch"
#: apps/client/src/pages/builder/sidebars/right/index.tsx:76
#: apps/client/src/pages/builder/sidebars/right/index.tsx:79
#: apps/client/src/pages/builder/sidebars/right/sections/statistics.tsx:23
msgid "Statistics"
msgstr "Statistics"
@ -1221,7 +1223,7 @@ msgstr "Support the app by donating what you can!"
msgid "System"
msgstr "System"
#: apps/client/src/pages/builder/sidebars/right/index.tsx:62
#: apps/client/src/pages/builder/sidebars/right/index.tsx:65
#: apps/client/src/pages/builder/sidebars/right/sections/template.tsx:18
msgid "Template"
msgstr "Template"
@ -1242,7 +1244,7 @@ msgstr "The passwords you entered do not match."
msgid "The resume you were looking for doesn't seem to exist, please check the link and try again."
msgstr "The resume you were looking for doesn't seem to exist, please check the link and try again."
#: apps/client/src/pages/builder/sidebars/right/index.tsx:71
#: apps/client/src/pages/builder/sidebars/right/index.tsx:74
#: apps/client/src/pages/builder/sidebars/right/sections/theme.tsx:20
#: apps/client/src/pages/dashboard/settings/_sections/profile.tsx:71
msgid "Theme"
@ -1303,12 +1305,12 @@ msgstr "Type <0>delete</0> to confirm deleting your account."
msgid "Type of Study"
msgstr "Type of Study"
#: apps/client/src/pages/builder/sidebars/right/index.tsx:68
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:67
#: apps/client/src/pages/builder/sidebars/right/index.tsx:71
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:66
msgid "Typography"
msgstr "Typography"
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:181
#: apps/client/src/pages/builder/sidebars/right/sections/typography.tsx:180
msgid "Underline Links"
msgstr "Underline Links"

File diff suppressed because it is too large Load Diff

View File

@ -106,7 +106,7 @@ export const SectionBase = <T extends SectionItem>({ id, title, description }: P
<Plus size={14} />
<span className="font-medium">
{t({
message: "Add New Item",
message: "Add a new item",
context: "For example, add a new work experience, or add a new profile.",
})}
</span>
@ -145,7 +145,7 @@ export const SectionBase = <T extends SectionItem>({ id, title, description }: P
<Plus />
<span>
{t({
message: "Add New Item",
message: "Add a new item",
context: "For example, add a new work experience, or add a new profile.",
})}
</span>

View File

@ -109,8 +109,8 @@ export const SectionOptions = ({ id }: Props) => {
<DropdownMenuSubContent>
<DropdownMenuRadioGroup value={`${section.columns}`} onValueChange={onChangeColumns}>
{Array.from({ length: 5 }, (_, i) => i + 1).map((value) => (
<DropdownMenuRadioItem value={`${value}`}>
{plural(value, { one: "Column", other: "Columns" })}
<DropdownMenuRadioItem key={value} value={`${value}`}>
{value} {plural(value, { one: "Column", other: "Columns" })}
</DropdownMenuRadioItem>
))}
</DropdownMenuRadioGroup>

View File

@ -8,6 +8,7 @@ import { ThemeSwitch } from "@/client/components/theme-switch";
import { ExportSection } from "./sections/export";
import { InformationSection } from "./sections/information";
import { LayoutSection } from "./sections/layout";
import { LocaleSection } from "./sections/locale";
import { NotesSection } from "./sections/notes";
import { PageSection } from "./sections/page";
import { SharingSection } from "./sections/sharing";
@ -39,6 +40,8 @@ export const RightSidebar = () => {
<Separator />
<PageSection />
<Separator />
<LocaleSection />
<Separator />
<SharingSection />
<Separator />
<StatisticsSection />

View File

@ -0,0 +1,48 @@
import { t } from "@lingui/macro";
import { useLingui } from "@lingui/react";
import { Combobox, Label } from "@reactive-resume/ui";
import { useMemo } from "react";
import { dynamicActivate, getLocales } from "@/client/libs/lingui";
import { useResumeStore } from "@/client/stores/resume";
import { getSectionIcon } from "../shared/section-icon";
export const LocaleSection = () => {
const { _ } = useLingui();
const setValue = useResumeStore((state) => state.setValue);
const locale = useResumeStore((state) => state.resume.data.metadata.locale);
const options = useMemo(() => {
return Object.entries(getLocales()).map(([value, label]) => ({
label,
value,
}));
}, [_]);
const onChangeLanguage = async (value: string) => {
setValue("metadata.locale", value);
await dynamicActivate(value);
// Update resume section titles with new locale
};
return (
<section id="locale" className="grid gap-y-6">
<header className="flex items-center justify-between">
<div className="flex items-center gap-x-4">
{getSectionIcon("locale")}
<h2 className="line-clamp-1 text-3xl font-bold">{t`Locale`}</h2>
</div>
</header>
<main className="grid gap-y-4">
<div className="space-y-1.5">
<Label>{t`Language`}</Label>
<Combobox value={locale} onValueChange={onChangeLanguage} options={options} />
</div>
</main>
</section>
);
};

View File

@ -14,7 +14,7 @@ import { getSectionIcon } from "../shared/section-icon";
const fontSuggestions = [
"Open Sans",
"Merriweather",
"CMU Serif",
"Roboto Condensed",
"Playfair Display",
"Lato",
"Lora",
@ -38,7 +38,6 @@ export const TypographySection = () => {
const loadFontSuggestions = useCallback(async () => {
fontSuggestions.forEach((font) => {
if (font === "CMU Serif") return;
webfontloader.load({
events: false,
classes: false,

View File

@ -9,20 +9,22 @@ import {
ReadCvLogo,
ShareFat,
TextT,
Translate,
TrendUp,
} from "@phosphor-icons/react";
import { Button, ButtonProps, Tooltip } from "@reactive-resume/ui";
export type MetadataKey =
| "notes"
| "template"
| "layout"
| "typography"
| "theme"
| "page"
| "locale"
| "sharing"
| "statistics"
| "export"
| "notes"
| "information";
export const getSectionIcon = (id: MetadataKey, props: IconProps = {}) => {
@ -40,6 +42,8 @@ export const getSectionIcon = (id: MetadataKey, props: IconProps = {}) => {
return <Palette size={18} {...props} />;
case "page":
return <ReadCvLogo size={18} {...props} />;
case "locale":
return <Translate size={18} {...props} />;
case "sharing":
return <ShareFat size={18} {...props} />;
case "statistics":

View File

@ -105,7 +105,7 @@ export const ProfileSettings = () => {
<FormDescription>
<span>
<Trans>
Don't see your locale?{" "}
Don't see your language?{" "}
<a
target="_blank"
rel="noopener noreferrer nofollow"

View File

@ -32,7 +32,7 @@ export const HeroSection = () => (
<div className="mt-10 space-y-2">
<h6 className="text-base font-bold tracking-wide">{t`Finally,`}</h6>
<h1 className="text-4xl font-bold tracking-tight sm:text-6xl">
{t`A free and open-source resume builder.`}
{t`A free and open-source resume builder`}
</h1>
</div>

View File

@ -1,27 +1,34 @@
import "@/client/libs/dayjs";
import { i18n } from "@lingui/core";
import { detect, fromNavigator, fromStorage, fromUrl } from "@lingui/detect-locale";
import { detect, fromNavigator, fromUrl } from "@lingui/detect-locale";
import { I18nProvider } from "@lingui/react";
import get from "lodash.get";
import { useEffect } from "react";
import { defaultLocale, dynamicActivate } from "../libs/lingui";
import { useAuthStore } from "../stores/auth";
import { useResumeStore } from "../stores/resume";
type Props = {
children: React.ReactNode;
};
export const LocaleProvider = ({ children }: Props) => {
const userLocale = useAuthStore((state) => get(state.user, "locale", null));
const resumeLocale = useResumeStore((state) => get(state.resume, "data.metadata.locale", null));
useEffect(() => {
const detectedLocale = detect(
resumeLocale,
userLocale,
fromUrl("lang"),
fromStorage("lang"),
fromNavigator(),
defaultLocale,
)!;
dynamicActivate(detectedLocale);
}, []);
}, [userLocale, resumeLocale]);
return <I18nProvider i18n={i18n}>{children}</I18nProvider>;
};

View File

@ -6,8 +6,6 @@ import fontkit from "@pdf-lib/fontkit";
import { ResumeDto } from "@reactive-resume/dto";
import { getFontUrls, withTimeout } from "@reactive-resume/utils";
import retry from "async-retry";
import { readFile } from "fs/promises";
import { join } from "path";
import { PDFDocument } from "pdf-lib";
import { connect } from "puppeteer";
@ -154,40 +152,20 @@ export class PrinterService {
// Get information about fonts used in the resume from the metadata
const fontData = resume.data.metadata.typography.font;
// Handle Special Case for CMU Serif as it is not available on Google Fonts
if (fontData.family === "CMU Serif") {
const fontsBuffer = await Promise.all([
readFile(join(__dirname, "assets/fonts/computer-modern/regular.ttf")),
readFile(join(__dirname, "assets/fonts/computer-modern/italic.ttf")),
readFile(join(__dirname, "assets/fonts/computer-modern/bold.ttf")),
]);
const fontUrls = getFontUrls(fontData.family, fontData.variants);
await Promise.all(
fontsBuffer.map((buffer) => {
// Convert Buffer to ArrayBuffer
const arrayBuffer = buffer.buffer.slice(
buffer.byteOffset,
buffer.byteOffset + buffer.byteLength,
);
return pdf.embedFont(arrayBuffer);
// Load all the fonts from the URLs using HttpService
const responses = await Promise.all(
fontUrls.map((url) =>
this.httpService.axiosRef.get(url, {
responseType: "arraybuffer",
}),
);
} else {
const fontUrls = getFontUrls(fontData.family, fontData.variants);
),
);
const fontsBuffer = responses.map((response) => response.data as ArrayBuffer);
// Load all the fonts from the URLs using HttpService
const responses = await Promise.all(
fontUrls.map((url) =>
this.httpService.axiosRef.get(url, {
responseType: "arraybuffer",
}),
),
);
const fontsBuffer = responses.map((response) => response.data as ArrayBuffer);
// Embed all the fonts in the PDF
await Promise.all(fontsBuffer.map((buffer) => pdf.embedFont(buffer)));
}
// Embed all the fonts in the PDF
await Promise.all(fontsBuffer.map((buffer) => pdf.embedFont(buffer)));
for (let index = 0; index < pagesBuffer.length; index++) {
const page = await PDFDocument.load(pagesBuffer[index]);

View File

@ -9,7 +9,7 @@ export const defaultLayout = [
// Schema
export const metadataSchema = z.object({
locale: z.string().default("en"),
locale: z.string().default("en-US"),
template: z.string().default("rhyhorn"),
layout: z.array(z.array(z.array(z.string()))).default(defaultLayout), // pages -> columns -> sections
css: z.object({
@ -47,7 +47,7 @@ export type Metadata = z.infer<typeof metadataSchema>;
// Defaults
export const defaultMetadata: Metadata = {
locale: "en",
locale: "en-US",
template: "rhyhorn",
layout: defaultLayout,
css: {

View File

@ -452,7 +452,7 @@ export const sampleResume: ResumeData = {
},
},
metadata: {
locale: "en",
locale: "en-US",
template: "pikachu",
layout: [
[

View File

@ -7,15 +7,6 @@ export type Font = {
};
export const fonts: Font[] = [
{
family: "CMU Serif",
category: "serif",
subsets: ["latin"],
variants: ["regular"],
files: {
regular: "https://cdn.jsdelivr.net/npm/computer-modern/cmu-serif.min.css",
},
},
{
family: "Roboto",
category: "sans-serif",

View File

@ -3,7 +3,8 @@ import type { LinguiConfig } from "@lingui/conf";
const config: LinguiConfig = {
format: "po",
sourceLocale: "en-US",
locales: ["en-US", "de-DE"],
pseudoLocale: "zu-ZA",
locales: ["en-US", "de-DE", "zu-ZA"],
catalogs: [
{
path: "<rootDir>/apps/client/src/locales/{locale}/messages",