Skip to content

Commit

Permalink
Add languages to picker
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jan 20, 2025
1 parent 23b0bd7 commit 1c491c9
Show file tree
Hide file tree
Showing 21 changed files with 478 additions and 146 deletions.
6 changes: 4 additions & 2 deletions apps/web/src/components/change-language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { useChangeLocale, useCurrentLocale } from "@/locales/client";
import { useChangeLocale, useCurrentLocale, useI18n } from "@/locales/client";
import languineConfig from "../../languine.config";

export function ChangeLanguage() {
const t = useI18n();
const changeLocale = useChangeLocale();
const currentLocale = useCurrentLocale();

Expand Down Expand Up @@ -38,7 +39,8 @@ export function ChangeLanguage() {
onClick={() => changeLocale(locale)}
className="uppercase text-xs"
>
{locale}
{/* @ts-ignore */}
{t(`language.${locale}`)}
</DropdownMenuItem>
))}
</DropdownMenuContent>
Expand Down
10 changes: 8 additions & 2 deletions apps/web/src/components/user-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { useCreateTeamModal } from "@/hooks/use-create-team-modal";
import { authClient } from "@/lib/auth/client";
import { useI18n } from "@/locales/client";
import Link from "next/link";
import { useParams, useRouter } from "next/navigation";

export function UserMenu() {
const { data: session } = authClient.useSession();
const { setOpen: openCreateTeamModal } = useCreateTeamModal();
const params = useParams();
const t = useI18n();
const router = useRouter();
Expand Down Expand Up @@ -66,11 +68,15 @@ export function UserMenu() {
{t("userMenu.team")}
</DropdownMenuItem>
</Link>
<Link href="/tuning" className="cursor-pointer text-xs">
<button
type="button"
onClick={() => openCreateTeamModal(true)}
className="cursor-pointer text-xs w-full"
>
<DropdownMenuItem className="text-sm">
{t("userMenu.createTeam")}
</DropdownMenuItem>
</Link>
</button>
<DropdownMenuSeparator />
<Link href="/">
<DropdownMenuItem className="text-sm">
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/lib/tiers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export const TIERS_MAX_KEYS = {
0: 100,
1: 1000,
1: 10000,
2: 20000,
3: 30000,
4: 50000,
5: 100000,
6: 200000,
7: 500000,
8: 1000000,
};
21 changes: 21 additions & 0 deletions apps/web/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,26 @@ export default {
hero2: {
title: "التوطين التلقائي لتطبيقاتك",
description: "تسهيل عملية التوطين الخاصة بك باستخدام واجهة سطر الأوامر والخط المدعوم بالذكاء الاصطناعي، والتي تم تصميمها لتلقين الترجمات للمطورين."
},
language: {
en: "الإنجليزية",
es: "الإسبانية",
fr: "الفرنسية",
de: "الألمانية",
it: "الإيطالية",
pt: "البرتغالية",
zh: "الصينية",
ja: "اليابانية",
ko: "الكورية",
ar: "العربية",
hi: "الهندية",
tr: "التركية",
nl: "الهولندية",
pl: "البولندية",
no: "النرويجية",
da: "الدنماركية",
sv: "السويدية",
fi: "الفنلندية",
vi: "الفيتنامية"
}
} as const;
21 changes: 21 additions & 0 deletions apps/web/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,26 @@ export default {
hero2: {
title: "Automatisierte Lokalisierung für Ihre Anwendungen",
description: "Optimieren Sie Ihren Lokalisierungsprozess mit einer KI-gestützten CLI und einem Pipeline-System, das speziell für Entwickler entwickelt wurde, um Übersetzungen zu automatisieren."
},
language: {
en: "Englisch",
es: "Spanisch",
fr: "Französisch",
de: "Deutsch",
it: "Italienisch",
pt: "Portugiesisch",
zh: "Chinesisch",
ja: "Japanisch",
ko: "Koreanisch",
ar: "Arabisch",
hi: "Hindi",
tr: "Türkisch",
nl: "Niederländisch",
pl: "Polnisch",
no: "Norwegisch",
da: "Dänisch",
sv: "Schwedisch",
fi: "Finnisch",
vi: "Vietnamesisch"
}
} as const;
21 changes: 21 additions & 0 deletions apps/web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,25 @@ export default {
monthly: "Monthly",
selectPeriod: "Select period",
},
language: {
en: "English",
es: "Spanish",
fr: "French",
de: "German",
it: "Italian",
pt: "Portuguese",
zh: "Chinese",
ja: "Japanese",
ko: "Korean",
ar: "Arabic",
hi: "Hindi",
tr: "Turkish",
nl: "Dutch",
pl: "Polish",
no: "Norwegian",
da: "Danish",
sv: "Swedish",
fi: "Finnish",
vi: "Vietnamese",
},
} as const;
21 changes: 21 additions & 0 deletions apps/web/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,26 @@ export default {
hero2: {
title: "Localización automatizada para tus aplicaciones",
description: "Optimiza tu proceso de localización con una CLI y un pipeline impulsados por IA, diseñados para automatizar las traducciones para desarrolladores."
},
language: {
en: "Inglés",
es: "Español",
fr: "Francés",
de: "Alemán",
it: "Italiano",
pt: "Portugués",
zh: "Chino",
ja: "Japonés",
ko: "Coreano",
ar: "Árabe",
hi: "Hindi",
tr: "Turco",
nl: "Holandés",
pl: "Polaco",
no: "Noruego",
da: "Danés",
sv: "Sueco",
fi: "Finlandés",
vi: "Vietnamita"
}
} as const;
21 changes: 21 additions & 0 deletions apps/web/src/locales/fi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,26 @@ export default {
hero2: {
title: "Automatisoi sovellustesi lokalisointi",
description: "Yksinkertaista lokalisointiprosessisi tekoälyä hyödyntävällä CLI:llä ja putkistolla, jotka on suunniteltu automatisoimaan käännökset kehittäjille."
},
language: {
en: "Englanti",
es: "Espanja",
fr: "Ranska",
de: "Saksa",
it: "Italia",
pt: "Portugali",
zh: "Kiina",
ja: "Japani",
ko: "Korea",
ar: "Arabia",
hi: "Hindi",
tr: "Turkki",
nl: "Hollanti",
pl: "Puola",
no: "Norja",
da: "Tanska",
sv: "Ruotsi",
fi: "Suomi",
vi: "Vietnam"
}
} as const;
21 changes: 21 additions & 0 deletions apps/web/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,26 @@ export default {
hero2: {
title: "Localisation automatisée pour vos applications",
description: "Optimisez votre processus de localisation avec une CLI et un pipeline alimentés par l'IA, conçus pour automatiser les traductions pour les développeurs."
},
language: {
en: "Anglais",
es: "Espagnol",
fr: "Français",
de: "Allemand",
it: "Italien",
pt: "Portugais",
zh: "Chinois",
ja: "Japonais",
ko: "Coréen",
ar: "Arabe",
hi: "Hindi",
tr: "Turc",
nl: "Néerlandais",
pl: "Polonais",
no: "Norvégien",
da: "Danois",
sv: "Suédois",
fi: "Finnois",
vi: "Vietnamien"
}
} as const;
Loading

0 comments on commit 1c491c9

Please sign in to comment.