Skip to content

Commit f68a603

Browse files
committed
feat: add locale selection for CVs with English and Portuguese support
1 parent 13c4a40 commit f68a603

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

frontend/src/components/FormSection.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CV } from "../types";
1+
import type { CV, locale } from "../types";
22
import RepeatableSection from "./RepeatableSection";
33

44
interface FormSectionProps {
@@ -16,6 +16,18 @@ export default function FormSection({
1616
}: FormSectionProps) {
1717
return (
1818
<form onSubmit={handleSubmit} className="space-y-5">
19+
<div className="text-lg font-semibold text-zinc-200">
20+
<label>CV Language</label>
21+
<select
22+
value={cV.locale}
23+
onChange={(e) => setCV({ ...cV, locale: e.target.value as locale })}
24+
className="ml-4 rounded-md border border-zinc-700 bg-zinc-800 px-3 py-2 outline-none focus:border-indigo-500"
25+
>
26+
<option value="en">English</option>
27+
<option value="pt">Português</option>
28+
</select>
29+
</div>
30+
1931
<div>
2032
<label className="mb-1 block text-sm text-zinc-400">
2133
CV name <span className="text-red-500">*</span>

frontend/src/pages/CreateCV.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default function CreateCVPage() {
1414
const [cV, setCV] = useState<CV>({
1515
id: "",
1616
cVName: "",
17+
locale: "en",
1718
firstName: "",
1819
lastName: "",
1920
middleName: null,
@@ -48,6 +49,7 @@ export default function CreateCVPage() {
4849
createCV({
4950
id,
5051
cVName: cV.cVName,
52+
locale: cV.locale,
5153
firstName: cV.firstName,
5254
lastName: cV.lastName,
5355
middleName: cV.middleName,

frontend/src/pages/EditCV.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default function EditCVPage() {
1818
const [cV, setCV] = useState<CV>({
1919
id: cVFinded?.id || "",
2020
cVName: cVFinded?.cVName || "",
21+
locale: cVFinded?.locale || "en",
2122
firstName: cVFinded?.firstName || "",
2223
lastName: cVFinded?.lastName || "",
2324
middleName: cVFinded?.middleName || null,
@@ -47,6 +48,7 @@ export default function EditCVPage() {
4748

4849
updateCV(cVFindedId, {
4950
cVName: cV.cVName,
51+
locale: cV.locale,
5052
firstName: cV.firstName,
5153
lastName: cV.lastName,
5254
middleName: cV.middleName,

frontend/src/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
export type locale = "en" | "pt";
2+
3+
export type locales = locale[];
4+
15
export interface CV {
26
id: string;
37
cVName: string;
48

9+
locale: locale;
10+
511
firstName: string;
612
middleName: string | null;
713
lastName: string;

0 commit comments

Comments
 (0)