From 32a9a67e7e11f0c2228831e3fae6e542e706f7ce Mon Sep 17 00:00:00 2001 From: Flomp Date: Thu, 5 Feb 2026 09:36:57 +0100 Subject: [PATCH] Adds czech (#774) Co-authored-by: Christian Beutel <> --- db/migrations/1770279739_updated_settings.go | 83 +++++++++++++++++++ web/src/lib/i18n/index.ts | 2 +- web/src/lib/i18n/locales/cs.json | 1 + web/src/lib/i18n/locales/de.json | 1 + web/src/lib/i18n/locales/en.json | 1 + web/src/lib/i18n/locales/es.json | 1 + web/src/lib/i18n/locales/eu.json | 1 + web/src/lib/i18n/locales/fr.json | 1 + web/src/lib/i18n/locales/hu.json | 1 + web/src/lib/i18n/locales/it.json | 1 + web/src/lib/i18n/locales/nl.json | 1 + web/src/lib/i18n/locales/no.json | 3 +- web/src/lib/i18n/locales/pl.json | 1 + web/src/lib/i18n/locales/pt.json | 1 + web/src/lib/i18n/locales/ru.json | 1 + web/src/lib/i18n/locales/zh.json | 1 + web/src/lib/models/settings.ts | 1 + web/src/routes/settings/language/+page.svelte | 1 + 18 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 db/migrations/1770279739_updated_settings.go diff --git a/db/migrations/1770279739_updated_settings.go b/db/migrations/1770279739_updated_settings.go new file mode 100644 index 00000000..191ece42 --- /dev/null +++ b/db/migrations/1770279739_updated_settings.go @@ -0,0 +1,83 @@ +package migrations + +import ( + "github.com/pocketbase/pocketbase/core" + m "github.com/pocketbase/pocketbase/migrations" +) + +func init() { + m.Register(func(app core.App) error { + collection, err := app.FindCollectionByNameOrId("uavt73rsqcn1n13") + if err != nil { + return err + } + + // update field + if err := collection.Fields.AddMarshaledJSONAt(1, []byte(`{ + "hidden": false, + "id": "0sepzvkh", + "maxSelect": 1, + "name": "language", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "en", + "de", + "fr", + "hu", + "it", + "nl", + "pl", + "pt", + "zh", + "es", + "eu", + "ru", + "no", + "cs" + ] + }`)); err != nil { + return err + } + + return app.Save(collection) + }, func(app core.App) error { + collection, err := app.FindCollectionByNameOrId("uavt73rsqcn1n13") + if err != nil { + return err + } + + // update field + if err := collection.Fields.AddMarshaledJSONAt(1, []byte(`{ + "hidden": false, + "id": "0sepzvkh", + "maxSelect": 1, + "name": "language", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "en", + "de", + "fr", + "hu", + "it", + "nl", + "pl", + "pt", + "zh", + "es", + "eu", + "ru", + "no" + ] + }`)); err != nil { + return err + } + + return app.Save(collection) + }) +} diff --git a/web/src/lib/i18n/index.ts b/web/src/lib/i18n/index.ts index 970772b1..a263ed13 100644 --- a/web/src/lib/i18n/index.ts +++ b/web/src/lib/i18n/index.ts @@ -3,7 +3,7 @@ import { getPb } from '$lib/pocketbase'; import { init, register } from 'svelte-i18n'; const defaultLocale = 'en' - +register('cs', () => import('./locales/cs.json')) register('en', () => import('./locales/en.json')) register('de', () => import('./locales/de.json')) register('es', () => import('./locales/es.json')) diff --git a/web/src/lib/i18n/locales/cs.json b/web/src/lib/i18n/locales/cs.json index 5672e0bd..08eccfd7 100644 --- a/web/src/lib/i18n/locales/cs.json +++ b/web/src/lib/i18n/locales/cs.json @@ -87,6 +87,7 @@ "current-password": "Současné heslo", "cycling": "Cyklistika", "cycling-speed": "Rychlost jízdy na kole", + "czech": "Čeština", "danger-zone": "Nebezpečná zóna", "date": "Datum", "default-category": "Výchozí kategorie", diff --git a/web/src/lib/i18n/locales/de.json b/web/src/lib/i18n/locales/de.json index 723dbe54..40b30900 100644 --- a/web/src/lib/i18n/locales/de.json +++ b/web/src/lib/i18n/locales/de.json @@ -88,6 +88,7 @@ "current-password": "Aktuelles Passwort", "cycling": "Radfahren", "cycling-speed": "Radfahrgeschwindigkeit", + "czech": "Tschechisch", "danger-zone": "Gefahrenzone", "date": "Datum", "default-category": "Standardkategorie", diff --git a/web/src/lib/i18n/locales/en.json b/web/src/lib/i18n/locales/en.json index 4dffaf1b..54323e2a 100644 --- a/web/src/lib/i18n/locales/en.json +++ b/web/src/lib/i18n/locales/en.json @@ -88,6 +88,7 @@ "current-password": "Current password", "cycling": "Cycling", "cycling-speed": "Cycling Speed", + "czech": "Czech", "danger-zone": "Danger zone", "date": "Date", "default-category": "Default category", diff --git a/web/src/lib/i18n/locales/es.json b/web/src/lib/i18n/locales/es.json index ec2c34a9..dc600989 100644 --- a/web/src/lib/i18n/locales/es.json +++ b/web/src/lib/i18n/locales/es.json @@ -87,6 +87,7 @@ "current-password": "Contraseña actual", "cycling": "Ciclismo", "cycling-speed": "Velocidad de ciclismo", + "czech": "", "danger-zone": "Zona peligrosa", "date": "Fecha", "default-category": "Categoría predefinida", diff --git a/web/src/lib/i18n/locales/eu.json b/web/src/lib/i18n/locales/eu.json index 84cfb54b..4fc8b43b 100644 --- a/web/src/lib/i18n/locales/eu.json +++ b/web/src/lib/i18n/locales/eu.json @@ -88,6 +88,7 @@ "current-password": "Oraingo pasahitza", "cycling": "Txirrindularitza", "cycling-speed": "Abiadura Bizikletan", + "czech": "", "danger-zone": "Arrisku-eremua", "date": "Data", "default-category": "Defektuzko kategoria", diff --git a/web/src/lib/i18n/locales/fr.json b/web/src/lib/i18n/locales/fr.json index dd27b2fc..ab5f2147 100644 --- a/web/src/lib/i18n/locales/fr.json +++ b/web/src/lib/i18n/locales/fr.json @@ -88,6 +88,7 @@ "current-password": "Mot de passe actuel", "cycling": "Vélo", "cycling-speed": "Vitesse à vélo", + "czech": "", "danger-zone": "Zone de danger", "date": "Date", "default-category": "Catégorie par défaut", diff --git a/web/src/lib/i18n/locales/hu.json b/web/src/lib/i18n/locales/hu.json index aeea2b37..01aedc61 100644 --- a/web/src/lib/i18n/locales/hu.json +++ b/web/src/lib/i18n/locales/hu.json @@ -88,6 +88,7 @@ "current-password": "Current password", "cycling": "Cycling", "cycling-speed": "Cycling Speed", + "czech": "", "danger-zone": "Veszélyes zóna", "date": "Dátum", "default-category": "Default category", diff --git a/web/src/lib/i18n/locales/it.json b/web/src/lib/i18n/locales/it.json index 894f3ca1..ecf3f03b 100644 --- a/web/src/lib/i18n/locales/it.json +++ b/web/src/lib/i18n/locales/it.json @@ -88,6 +88,7 @@ "current-password": "Password attuale", "cycling": "Ciclismo", "cycling-speed": "Cycling Speed", + "czech": "", "danger-zone": "Zona di pericolo", "date": "Data", "default-category": "Categoria predefinita", diff --git a/web/src/lib/i18n/locales/nl.json b/web/src/lib/i18n/locales/nl.json index 024664f4..7e266d19 100644 --- a/web/src/lib/i18n/locales/nl.json +++ b/web/src/lib/i18n/locales/nl.json @@ -89,6 +89,7 @@ "current-password": "Huidig wachtwoord", "cycling": "Fietsen", "cycling-speed": "Fietssnelheid", + "czech": "", "danger-zone": "Gevarenzone", "date": "Datum", "default-category": "Standaardcategorie", diff --git a/web/src/lib/i18n/locales/no.json b/web/src/lib/i18n/locales/no.json index c7dd0904..d5b87c9a 100644 --- a/web/src/lib/i18n/locales/no.json +++ b/web/src/lib/i18n/locales/no.json @@ -87,6 +87,7 @@ "current-password": "Nåværende passord", "cycling": "Sykling", "cycling-speed": "Sykkelfart", + "czech": "", "danger-zone": "Faresone", "date": "Dato", "default-category": "Standardkategori", @@ -426,4 +427,4 @@ "width": "Bredde", "wrong-username-or-password": "Feil brukernavn eller passord", "you-can": "Du kan" -} \ No newline at end of file +} diff --git a/web/src/lib/i18n/locales/pl.json b/web/src/lib/i18n/locales/pl.json index 3ccb58db..73ef29af 100644 --- a/web/src/lib/i18n/locales/pl.json +++ b/web/src/lib/i18n/locales/pl.json @@ -88,6 +88,7 @@ "current-password": "Obecne hasło", "cycling": "Rower", "cycling-speed": "Prędkość jazdy na rowerze", + "czech": "", "danger-zone": "Strefa niebezpieczna", "date": "Data", "default-category": "Domyślna kategoria", diff --git a/web/src/lib/i18n/locales/pt.json b/web/src/lib/i18n/locales/pt.json index ef87d0d2..6ef43132 100644 --- a/web/src/lib/i18n/locales/pt.json +++ b/web/src/lib/i18n/locales/pt.json @@ -88,6 +88,7 @@ "current-password": "Senha atual", "cycling": "Ciclismo", "cycling-speed": "Cycling Speed", + "czech": "", "danger-zone": "Zona de perigo", "date": "Data", "default-category": "Categoria inicial", diff --git a/web/src/lib/i18n/locales/ru.json b/web/src/lib/i18n/locales/ru.json index 310278b4..af2a6b1e 100644 --- a/web/src/lib/i18n/locales/ru.json +++ b/web/src/lib/i18n/locales/ru.json @@ -88,6 +88,7 @@ "current-password": "Текущий пароль", "cycling": "Велосипед", "cycling-speed": "Скорость велосипеда", + "czech": "", "danger-zone": "Внимание!", "date": "Дата", "default-category": "Категория по умолчанию", diff --git a/web/src/lib/i18n/locales/zh.json b/web/src/lib/i18n/locales/zh.json index 629d3ae4..8a655730 100644 --- a/web/src/lib/i18n/locales/zh.json +++ b/web/src/lib/i18n/locales/zh.json @@ -88,6 +88,7 @@ "current-password": "当前密码", "cycling": "骑行", "cycling-speed": "骑车速度", + "czech": "", "danger-zone": "危险区域", "date": "日期", "default-category": "默认分类", diff --git a/web/src/lib/models/settings.ts b/web/src/lib/models/settings.ts index d15bde31..6b18739a 100644 --- a/web/src/lib/models/settings.ts +++ b/web/src/lib/models/settings.ts @@ -1,6 +1,7 @@ import type { NotificationType } from "./notification"; export enum Language { + cs = "cs", en = "en", de = "de", es = "es", diff --git a/web/src/routes/settings/language/+page.svelte b/web/src/routes/settings/language/+page.svelte index 6864d687..7937ea46 100644 --- a/web/src/routes/settings/language/+page.svelte +++ b/web/src/routes/settings/language/+page.svelte @@ -13,6 +13,7 @@ const settings = page.data.settings; const languages: SelectItem[] = [ + { text: $_("czech"), value: "cs" }, { text: $_("english"), value: "en" }, { text: $_("german"), value: "de" }, { text: $_("spanish"), value: "es" },