83
db/migrations/1770279739_updated_settings.go
Normal file
83
db/migrations/1770279739_updated_settings.go
Normal file
@@ -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)
|
||||
})
|
||||
}
|
||||
@@ -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'))
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"current-password": "Aktuelles Passwort",
|
||||
"cycling": "Radfahren",
|
||||
"cycling-speed": "Radfahrgeschwindigkeit",
|
||||
"czech": "Tschechisch",
|
||||
"danger-zone": "Gefahrenzone",
|
||||
"date": "Datum",
|
||||
"default-category": "Standardkategorie",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
"current-password": "Huidig wachtwoord",
|
||||
"cycling": "Fietsen",
|
||||
"cycling-speed": "Fietssnelheid",
|
||||
"czech": "",
|
||||
"danger-zone": "Gevarenzone",
|
||||
"date": "Datum",
|
||||
"default-category": "Standaardcategorie",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"current-password": "Текущий пароль",
|
||||
"cycling": "Велосипед",
|
||||
"cycling-speed": "Скорость велосипеда",
|
||||
"czech": "",
|
||||
"danger-zone": "Внимание!",
|
||||
"date": "Дата",
|
||||
"default-category": "Категория по умолчанию",
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"current-password": "当前密码",
|
||||
"cycling": "骑行",
|
||||
"cycling-speed": "骑车速度",
|
||||
"czech": "",
|
||||
"danger-zone": "危险区域",
|
||||
"date": "日期",
|
||||
"default-category": "默认分类",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { NotificationType } from "./notification";
|
||||
|
||||
export enum Language {
|
||||
cs = "cs",
|
||||
en = "en",
|
||||
de = "de",
|
||||
es = "es",
|
||||
|
||||
@@ -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" },
|
||||
|
||||
Reference in New Issue
Block a user