adds es, eu, ru translations

This commit is contained in:
Christian Beutel
2025-08-24 15:23:54 +02:00
parent a00d92e93b
commit a8de5d075f
16 changed files with 115 additions and 8 deletions

View File

@@ -0,0 +1,78 @@
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"
]
}`)); 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"
]
}`)); err != nil {
return err
}
return app.Save(collection)
})
}

View File

@@ -6,12 +6,15 @@ const defaultLocale = 'en'
register('en', () => import('./locales/en.json')) register('en', () => import('./locales/en.json'))
register('de', () => import('./locales/de.json')) register('de', () => import('./locales/de.json'))
register('es', () => import('./locales/es.json'))
register('eu', () => import('./locales/eu.json'))
register('fr', () => import('./locales/fr.json')) register('fr', () => import('./locales/fr.json'))
register('hu', () => import('./locales/hu.json')) register('hu', () => import('./locales/hu.json'))
register('it', () => import('./locales/it.json')) register('it', () => import('./locales/it.json'))
register('nl', () => import('./locales/nl.json')) register('nl', () => import('./locales/nl.json'))
register('pl', () => import('./locales/pl.json')) register('pl', () => import('./locales/pl.json'))
register('pt', () => import('./locales/pt.json')) register('pt', () => import('./locales/pt.json'))
register('ru', () => import('./locales/ru.json'))
register('zh', () => import('./locales/zh.json')) register('zh', () => import('./locales/zh.json'))
init({ init({

View File

@@ -56,6 +56,7 @@
"car": "Auto", "car": "Auto",
"car-motorcycle": "Auto/Motorrad", "car-motorcycle": "Auto/Motorrad",
"card": "{n, plural, =1 {Karte} other {Karten}}", "card": "{n, plural, =1 {Karte} other {Karten}}",
"catalan": "Katalanisch",
"categories": "Kategorien", "categories": "Kategorien",
"category": "Kategorie", "category": "Kategorie",
"change": "Ändern", "change": "Ändern",
@@ -335,6 +336,7 @@
"road": "Straße", "road": "Straße",
"route": "{n, plural, =1 {Route} other {Routen}}", "route": "{n, plural, =1 {Route} other {Routen}}",
"route-point": "Punkt auf Route", "route-point": "Punkt auf Route",
"russian": "",
"save": "Speichern", "save": "Speichern",
"save-list": "Liste speichern", "save-list": "Liste speichern",
"save-trail": "Route speichern", "save-trail": "Route speichern",

View File

@@ -56,6 +56,7 @@
"car": "Car", "car": "Car",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Card} other {Cards}}", "card": "{n, plural, =1 {Card} other {Cards}}",
"catalan": "Catalan",
"categories": "Categories", "categories": "Categories",
"category": "Category", "category": "Category",
"change": "Change", "change": "Change",
@@ -335,6 +336,7 @@
"road": "Road", "road": "Road",
"route": "{n, plural, =1 {Route} other {Routes}}", "route": "{n, plural, =1 {Route} other {Routes}}",
"route-point": "Route Point", "route-point": "Route Point",
"russian": "Russian",
"save": "Save", "save": "Save",
"save-list": "Save List", "save-list": "Save List",
"save-trail": "Save Trail", "save-trail": "Save Trail",

View File

@@ -56,6 +56,7 @@
"car": "Coche", "car": "Coche",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, one {}=1 {Ficha} other {Fichas}}", "card": "{n, plural, one {}=1 {Ficha} other {Fichas}}",
"catalan": "",
"categories": "Categorías", "categories": "Categorías",
"category": "Categoría", "category": "Categoría",
"change": "Modificar", "change": "Modificar",
@@ -335,6 +336,7 @@
"road": "Carretera", "road": "Carretera",
"route": "{n, plural, =1 {Route} other {Routes}}", "route": "{n, plural, =1 {Route} other {Routes}}",
"route-point": "Route Point", "route-point": "Route Point",
"russian": "",
"save": "Guardar", "save": "Guardar",
"save-list": "Guardar Lista", "save-list": "Guardar Lista",
"save-trail": "Guardar Ruta", "save-trail": "Guardar Ruta",

View File

@@ -56,6 +56,7 @@
"car": "Kotxea", "car": "Kotxea",
"car-motorcycle": "Kotxea/Motozikleta", "car-motorcycle": "Kotxea/Motozikleta",
"card": "{n, plural, one {}=1 {Txartea} other {Txartelak}}", "card": "{n, plural, one {}=1 {Txartea} other {Txartelak}}",
"catalan": "Catalan",
"categories": "Kategoriak", "categories": "Kategoriak",
"category": "Kategoria", "category": "Kategoria",
"change": "Aldatu", "change": "Aldatu",
@@ -336,6 +337,7 @@
"route": "{n, plural, one {}=1 {Ibilbidea} other {Ibilbideak}}", "route": "{n, plural, one {}=1 {Ibilbidea} other {Ibilbideak}}",
"route-point": "Ibilbideko puntua", "route-point": "Ibilbideko puntua",
"save": "Gorde", "save": "Gorde",
"russian": "Russian",
"save-list": "Gorde zerrenda", "save-list": "Gorde zerrenda",
"save-trail": "Gorde ibilaldia", "save-trail": "Gorde ibilaldia",
"save-your-trail-first": "Gorde zure ibilaldia lehenengo", "save-your-trail-first": "Gorde zure ibilaldia lehenengo",

View File

@@ -56,6 +56,7 @@
"car": "Voiture", "car": "Voiture",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Tuile} other {Tuiles}}", "card": "{n, plural, =1 {Tuile} other {Tuiles}}",
"catalan": "",
"categories": "Catégories", "categories": "Catégories",
"category": "Catégorie", "category": "Catégorie",
"change": "Changement", "change": "Changement",
@@ -335,6 +336,7 @@
"road": "Route", "road": "Route",
"route": "{n, plural, =1 {Itinéraire} other {Itinéraires}}", "route": "{n, plural, =1 {Itinéraire} other {Itinéraires}}",
"route-point": "Étape", "route-point": "Étape",
"russian": "",
"save": "Sauvegarder", "save": "Sauvegarder",
"save-list": "Sauvegarder la liste", "save-list": "Sauvegarder la liste",
"save-trail": "Sauvegarder l'itinéraire", "save-trail": "Sauvegarder l'itinéraire",

View File

@@ -56,6 +56,7 @@
"car": "Car", "car": "Car",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Kártya} other {Kártyák}}", "card": "{n, plural, =1 {Kártya} other {Kártyák}}",
"catalan": "",
"categories": "Kategóriák", "categories": "Kategóriák",
"category": "Kategória", "category": "Kategória",
"change": "Változás", "change": "Változás",
@@ -335,6 +336,7 @@
"road": "Road", "road": "Road",
"route": "{n, plural, =1 {Route} other {Routes}}", "route": "{n, plural, =1 {Route} other {Routes}}",
"route-point": "Route Point", "route-point": "Route Point",
"russian": "",
"save": "Mentés", "save": "Mentés",
"save-list": "Save List", "save-list": "Save List",
"save-trail": "Útvonal mentése", "save-trail": "Útvonal mentése",

View File

@@ -56,6 +56,7 @@
"car": "Car", "car": "Car",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Carta} other {Carte}}", "card": "{n, plural, =1 {Carta} other {Carte}}",
"catalan": "",
"categories": "Categorie", "categories": "Categorie",
"category": "Categoria", "category": "Categoria",
"change": "Modifica", "change": "Modifica",
@@ -335,6 +336,7 @@
"road": "Road", "road": "Road",
"route": "{n, plural, =1 {Route} other {Routes}}", "route": "{n, plural, =1 {Route} other {Routes}}",
"route-point": "Route Point", "route-point": "Route Point",
"russian": "",
"save": "Salva", "save": "Salva",
"save-list": "Salta Lista", "save-list": "Salta Lista",
"save-trail": "Salva percorso", "save-trail": "Salva percorso",

View File

@@ -56,6 +56,7 @@
"car": "Wagen", "car": "Wagen",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Kaart} other {Kaarten}}", "card": "{n, plural, =1 {Kaart} other {Kaarten}}",
"catalan": "",
"categories": "Categorieën", "categories": "Categorieën",
"category": "Categorie", "category": "Categorie",
"change": "Wijzigen", "change": "Wijzigen",
@@ -335,6 +336,7 @@
"road": "Weg", "road": "Weg",
"route": "{n, plural,=1 {Tocht} other {Tochten}}", "route": "{n, plural,=1 {Tocht} other {Tochten}}",
"route-point": "Routepunt", "route-point": "Routepunt",
"russian": "",
"save": "Bewaren", "save": "Bewaren",
"save-list": "Bewaar lijst", "save-list": "Bewaar lijst",
"save-trail": "Bewaar Route", "save-trail": "Bewaar Route",

View File

@@ -56,6 +56,7 @@
"car": "Samochód", "car": "Samochód",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Karta} other {Karty}}", "card": "{n, plural, =1 {Karta} other {Karty}}",
"catalan": "",
"categories": "Kategorie", "categories": "Kategorie",
"category": "Kategoria", "category": "Kategoria",
"change": "Zmień", "change": "Zmień",
@@ -335,6 +336,7 @@
"road": "Droga", "road": "Droga",
"route": "{n, plural,=1 {Trasa} other {Trasy}}", "route": "{n, plural,=1 {Trasa} other {Trasy}}",
"route-point": "Punkt trasy", "route-point": "Punkt trasy",
"russian": "",
"save": "Zapisz", "save": "Zapisz",
"save-list": "Zapisz listę", "save-list": "Zapisz listę",
"save-trail": "Zapisz szlak", "save-trail": "Zapisz szlak",

View File

@@ -56,6 +56,7 @@
"car": "Car", "car": "Car",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Cartão} other {Cartões}}", "card": "{n, plural, =1 {Cartão} other {Cartões}}",
"catalan": "",
"categories": "Categorias", "categories": "Categorias",
"category": "Categoria", "category": "Categoria",
"change": "Alterar", "change": "Alterar",
@@ -335,6 +336,7 @@
"road": "Road", "road": "Road",
"route": "{n, plural, =1 {Route} other {Routes}}", "route": "{n, plural, =1 {Route} other {Routes}}",
"route-point": "Route Point", "route-point": "Route Point",
"russian": "",
"save": "Guardar", "save": "Guardar",
"save-list": "Gravar lista", "save-list": "Gravar lista",
"save-trail": "Guardar trilho", "save-trail": "Guardar trilho",

View File

@@ -56,6 +56,7 @@
"car": "Автомобиль:", "car": "Автомобиль:",
"car-motorcycle": "Car/Motorcycle", "car-motorcycle": "Car/Motorcycle",
"card": "{n, plural, =1 {Карточка} other {Карточки}}", "card": "{n, plural, =1 {Карточка} other {Карточки}}",
"catalan": "Catalan",
"categories": "Категории", "categories": "Категории",
"category": "Категория", "category": "Категория",
"change": "Изменить", "change": "Изменить",
@@ -337,6 +338,7 @@
"route-point": "Точка маршрута", "route-point": "Точка маршрута",
"save": "Сохранить", "save": "Сохранить",
"save-list": "Сохранить список", "save-list": "Сохранить список",
"russian": "Russian",
"save-trail": "Сохранить трек", "save-trail": "Сохранить трек",
"save-your-trail-first": "Сначала сохраните трек", "save-your-trail-first": "Сначала сохраните трек",
"search-cities": "Поиск по городам", "search-cities": "Поиск по городам",
@@ -423,4 +425,4 @@
"width": "Ширина", "width": "Ширина",
"wrong-username-or-password": "Неверный логин или пароль", "wrong-username-or-password": "Неверный логин или пароль",
"you-can": "Вы можете" "you-can": "Вы можете"
} }

View File

@@ -56,6 +56,7 @@
"car": "汽车", "car": "汽车",
"car-motorcycle": "汽车/摩托车", "car-motorcycle": "汽车/摩托车",
"card": "{n, plural, =1 {卡片} other {卡片}}", "card": "{n, plural, =1 {卡片} other {卡片}}",
"catalan": "",
"categories": "分类", "categories": "分类",
"category": "分类", "category": "分类",
"change": "更换", "change": "更换",
@@ -335,6 +336,7 @@
"road": "道路", "road": "道路",
"route": "{n, plural, =1 {Route} other {Routes}}", "route": "{n, plural, =1 {Route} other {Routes}}",
"route-point": "路线点", "route-point": "路线点",
"russian": "",
"save": "保存", "save": "保存",
"save-list": "保存列表", "save-list": "保存列表",
"save-trail": "保存路线", "save-trail": "保存路线",

View File

@@ -4,12 +4,14 @@ export enum Language {
en = "en", en = "en",
de = "de", de = "de",
es = "es", es = "es",
eu = "eu",
fr = "fr", fr = "fr",
hu = "hu", hu = "hu",
it = "it", it = "it",
nl = "nl", nl = "nl",
pl = "pl", pl = "pl",
pt = "pt", pt = "pt",
ru = "ru",
zh = "zh" zh = "zh"
} }

View File

@@ -8,21 +8,23 @@
} from "$lib/components/base/select.svelte"; } from "$lib/components/base/select.svelte";
import type { Language } from "$lib/models/settings"; import type { Language } from "$lib/models/settings";
import { settings_update } from "$lib/stores/settings_store"; import { settings_update } from "$lib/stores/settings_store";
import { _, locale } from "svelte-i18n"; import { _ } from "svelte-i18n";
const settings = page.data.settings; const settings = page.data.settings;
const languages: SelectItem[] = [ const languages: SelectItem[] = [
{ text: $_("chinese"), value: "zh" },
{ text: $_("german"), value: "de" },
{ text: $_("english"), value: "en" }, { text: $_("english"), value: "en" },
{ text: $_("german"), value: "de" },
{ text: $_("spanish"), value: "es" }, { text: $_("spanish"), value: "es" },
{ text: $_("catalan"), value: "eu" },
{ text: $_("french"), value: "fr" }, { text: $_("french"), value: "fr" },
{ text: $_("hungarian"), value: "hu" }, { text: $_("hungarian"), value: "hu" },
{ text: $_("italian"), value: "it" }, { text: $_("italian"), value: "it" },
{ text: $_("dutch"), value: "nl" }, { text: $_("dutch"), value: "nl" },
{ text: $_("polish"), value: "pl" }, { text: $_("polish"), value: "pl" },
{ text: $_("portuguese"), value: "pt" }, { text: $_("portuguese"), value: "pt" },
{ text: $_("russian"), value: "ru" },
{ text: $_("chinese"), value: "zh" },
]; ];
const units: RadioItem[] = [ const units: RadioItem[] = [
@@ -32,9 +34,7 @@
let selectedLanguage = $state(settings?.language ?? "en"); let selectedLanguage = $state(settings?.language ?? "en");
async function handleLanguageSelection( async function handleLanguageSelection(value: Language) {
value: Language,
) {
await settings_update({ await settings_update({
id: settings!.id, id: settings!.id,
language: value, language: value,
@@ -67,4 +67,4 @@
items={units} items={units}
selected={settings?.unit == "metric" ? 0 : 1} selected={settings?.unit == "metric" ? 0 : 1}
onchange={handleUnitSelection} onchange={handleUnitSelection}
></RadioGroup> ></RadioGroup>