feat: validate translations with typescript (when added)

This commit is contained in:
Dariusz Niemczyk 2025-01-29 21:00:07 +01:00
parent 09038467f2
commit 401b8046ec
No known key found for this signature in database

View file

@ -1,5 +1,5 @@
export const translations = { const pl = {
pl: { siteTitle: "CEBULACAMP",
nav: { nav: {
about: "O nas", about: "O nas",
when: "Kiedy", when: "Kiedy",
@ -12,7 +12,6 @@ export const translations = {
mobileNav: { mobileNav: {
toggleMenu: "Aktywnuj menu", toggleMenu: "Aktywnuj menu",
menu: "Menu", menu: "Menu",
}, },
hero: { hero: {
title: "CEBULACAMP 2025", title: "CEBULACAMP 2025",
@ -25,8 +24,7 @@ export const translations = {
}, },
where: { where: {
title: "Gdzie", title: "Gdzie",
location: location: "klub Łącznik, Tramwajowa 1-3, Wrocław, obok Hackerspace Wrocław",
"klub Łącznik, Tramwajowa 1-3, Wrocław, obok Hackerspace Wrocław",
}, },
when: { when: {
title: "Kiedy", title: "Kiedy",
@ -52,8 +50,17 @@ export const translations = {
title: "Kontakt", title: "Kontakt",
email: "contact@cebula.camp", email: "contact@cebula.camp",
}, },
},
en: {
// English translations would go here
},
}; };
const en = {};
export const translations: {
en: typeof pl;
pl: typeof pl;
} = {
pl: pl,
// @ts-expect-error This should fail so far, remove me when translations are properly added to "en" object.
en: en,
};
export type Sections = keyof (typeof pl)["nav"];