Skip to content

Commit

Permalink
feat: Added Czech translation to Next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbrembeck committed May 8, 2023
1 parent 0f9a268 commit f9b86c5
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 7 deletions.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = withPWA({
reactStrictMode: true,
productionBrowserSourceMaps: true,
i18n: {
locales: ['de', 'en', 'fr', 'es', 'pl'],
locales: ['de', 'en', 'fr', 'es', 'pl', 'cz'],
defaultLocale: 'en',
},
async rewrites() {
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"devDependencies": {
"@playwright/test": "^1.33.0",
"@types/nookies": "^2.0.3",
"eslint": "8.39.0",
"eslint-config-next": "^13.3.4",
"eslint-config-sznm": "^1.1.1"
Expand Down
3 changes: 2 additions & 1 deletion src/locales/cs.json → src/locales/cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"french": "Francoužština",
"polish": "Polština",
"cursed": "Prokletý",
"memeculture": "Oslava meme-kultury"
"memeculture": "Oslava meme-kultury",
"czech": "Česky"
},
"TOS": {
"englishgermanonly": "Tato stránka je k dispozici pouze v angličtině a němčině.",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"french": "Französisch",
"polish": "Polnisch",
"cursed": "Überraschung",
"memeculture": "Hoch lebe die Meme-Kultur!"
"memeculture": "Hoch lebe die Meme-Kultur!",
"czech": "Tschechisch"
},
"TOS": {
"englishgermanonly": "Die Nutzungsbedingungen sind nur in Englisch und Deutsch verfügbar.",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"french": "French",
"polish": "Polish",
"cursed": "Cursed",
"memeculture": "Celebrating meme-culture"
"memeculture": "Celebrating meme-culture",
"czech": "Czech"
},
"TOS": {
"englishgermanonly": "This page is only available in English and German.",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"french": "Francés",
"polish": "Polaco",
"cursed": "Sorpresa",
"memeculture": "¡Viva la cultura del meme!"
"memeculture": "¡Viva la cultura del meme!",
"czech": "Checa"
},
"TOS": {
"englishgermanonly": "Esta página sólo está disponible en inglés y alemán.",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"french": "Français",
"polish": "Polonais",
"cursed": "Surprise",
"memeculture": "Vive la culture des memes !"
"memeculture": "Vive la culture des memes !",
"czech": "Tchèque"
},
"TOS": {
"englishgermanonly": "Cette page est uniquement disponible en anglais et en allemand.",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"french": "francuski",
"polish": "polski",
"cursed": "przeklęty",
"memeculture": "Niech żyje kultura memów!"
"memeculture": "Niech żyje kultura memów!",
"czech": "Czeski"
},
"TOS": {
"englishgermanonly": "Ta strona jest dostępna tylko w języku angielskim i niemieckim.",
Expand Down
18 changes: 18 additions & 0 deletions src/pages/more.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,24 @@ export default function More() {
<span className="price">{t("polish")}</span>
</div>
</Link>
<Link
className="nolink"
href="/more"
locale="cz"
onClick={() => handleLanguageChange("cz")}
>
<div
className={router.locale === "cz" ? "option active" : "option"}
>
<input
className="form-check-input"
type="radio"
name="flexRadioDefault"
checked={router.locale === "cz"}
/>
<span className="price">{t("czech")}</span>
</div>
</Link>
<span className="info" id="cookieinfo">
{t("thissetsacookie")}
</span>
Expand Down

0 comments on commit f9b86c5

Please sign in to comment.