adds hungarian translation
This commit is contained in:
81
db/migrations/1711883208_updated_users.go
Normal file
81
db/migrations/1711883208_updated_users.go
Normal file
@@ -0,0 +1,81 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("_pb_users_auth_")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_language := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "t1wlsqyp",
|
||||
"name": "language",
|
||||
"type": "select",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"en",
|
||||
"de",
|
||||
"fr",
|
||||
"hu",
|
||||
"nl",
|
||||
"pl",
|
||||
"pt"
|
||||
]
|
||||
}
|
||||
}`), edit_language)
|
||||
collection.Schema.AddField(edit_language)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("_pb_users_auth_")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_language := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "t1wlsqyp",
|
||||
"name": "language",
|
||||
"type": "select",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"en",
|
||||
"de",
|
||||
"fr",
|
||||
"nl",
|
||||
"pl",
|
||||
"pt"
|
||||
]
|
||||
}
|
||||
}`), edit_language)
|
||||
collection.Schema.AddField(edit_language)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -8,6 +8,7 @@ const defaultLocale = 'en'
|
||||
register('en', () => import('./locales/en.json'))
|
||||
register('de', () => import('./locales/de.json'))
|
||||
register('fr', () => import('./locales/fr.json'))
|
||||
register('hu', () => import('./locales/hu.json'))
|
||||
register('nl', () => import('./locales/nl.json'))
|
||||
register('pl', () => import('./locales/pl.json'))
|
||||
register('pt', () => import('./locales/pt.json'))
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
"hero_section_1_text": "Hier sind einige Routen, die dir gefallen könnten. Oder du wirfst einen Blick auf die vollständige Liste.",
|
||||
"hero_section_1_text_alternative": "Speichere dein letztes Abenteuer, um loszulegen.",
|
||||
"hero_section_2_text": "Wusstest du schon? Du kannst nicht nur deine Routen speichern. Es gibt viele Kategorien für alle deine Abenteuer.",
|
||||
"hungarian": "Ungarisch",
|
||||
"icon": "Icon",
|
||||
"imperial": "Amerikanisch",
|
||||
"invalid-date": "Ungültiges Datum",
|
||||
@@ -79,7 +80,7 @@
|
||||
"map": "Karte",
|
||||
"metric": "Metrisch",
|
||||
"moderate": "Mittel",
|
||||
"must-be-at-least-8-characters-long": "Muss mindestens 8 Zeichen lang sein",
|
||||
"must-be-at-least-n-characters-long": "Muss mindestens {n} Zeichen lang sein",
|
||||
"name": "Name",
|
||||
"near": "Nahe",
|
||||
"new-list": "Neue Liste",
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
"hero_section_1_text": "Here are some trails you might like. Or you can just go to the full list right now.",
|
||||
"hero_section_1_text_alternative": "Get started by saving your latest adventure.",
|
||||
"hero_section_2_text": "Did you know? You cannot only save you hiking trails. There are many categories for all your adventures.",
|
||||
"hungarian": "Hungarian",
|
||||
"icon": "Icon",
|
||||
"imperial": "Imperial",
|
||||
"invalid-date": "Invalid Date",
|
||||
@@ -79,7 +80,7 @@
|
||||
"map": "Map",
|
||||
"metric": "Metric",
|
||||
"moderate": "Moderate",
|
||||
"must-be-at-least-8-characters-long": "Must be at least 8 characters long",
|
||||
"must-be-at-least-n-characters-long": "Must be at least {n} characters long",
|
||||
"name": "Name",
|
||||
"near": "Near",
|
||||
"new-list": "New List",
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
"hero_section_1_text": "Voici quelques itinéraires qui pourraient vous plaire. Vous pouvez également consulter la liste complète dès maintenant.",
|
||||
"hero_section_1_text_alternative": "Commencez par enregistrer votre dernière aventure.",
|
||||
"hero_section_2_text": "Le saviez-vous ? Vous ne pouvez pas vous contenter que de sauver vos itinéraires de randonnée. Il existe de nombreuses catégories pour toutes vos aventures.",
|
||||
"hungarian": "Hongrois",
|
||||
"icon": "Icône",
|
||||
"imperial": "Impérial",
|
||||
"invalid-date": "Date invalide",
|
||||
@@ -79,7 +80,7 @@
|
||||
"map": "Carte",
|
||||
"metric": "Métrique",
|
||||
"moderate": "Modérer",
|
||||
"must-be-at-least-8-characters-long": "Doit être composé d'au moins 8 caractères",
|
||||
"must-be-at-least-n-characters-long": "Doit être composé d'au moins {n} caractères",
|
||||
"name": "Nom",
|
||||
"near": "Proche",
|
||||
"new-list": "Nouvelle liste",
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
"hero_section_1_text": "Íme néhány nyomvonal, amely tetszeni fog. Vagy csak menj a teljes listára most rögtön.",
|
||||
"hero_section_1_text_alternative": "Kezdje a legújabb kaland elmentésével.",
|
||||
"hero_section_2_text": "Tudta? Nem csak a túraútvonalakat mentheti el. Számos kategória létezik minden kalandodhoz.",
|
||||
"hungary": "Magyar",
|
||||
"hungarian": "Magyar",
|
||||
"icon": "Ikon",
|
||||
"imperial": "Angolszász",
|
||||
"invalid-date": "Érvénytelen dátum",
|
||||
@@ -80,7 +80,7 @@
|
||||
"map": "Térkép",
|
||||
"metric": "Metrikus",
|
||||
"moderate": "Mérsékelt",
|
||||
"must-be-at-least-8-characters-long": "Legalább 8 karakter hosszúnak kell lennie",
|
||||
"must-be-at-least-n-characters-long": "Legalább {n} karakter hosszúnak kell lennie",
|
||||
"name": "Név",
|
||||
"near": "Közelben",
|
||||
"new-list": "Új lista",
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
"hero_section_1_text": "Hier zijn enkele routes die je misschien leuk vindt. Of je kan ook de volledige lijst bekijken.",
|
||||
"hero_section_1_text_alternative": "Sla je laatste avontuur op om te beginnen.",
|
||||
"hero_section_2_text": "Wist je dat? Je kan niet alleen wandelroutes opslaan. Er zijn verschillende categorieën voor al je avonturen.",
|
||||
"hungarian": "Hongaars",
|
||||
"icon": "Icoon",
|
||||
"imperial": "Amerikaans",
|
||||
"invalid-date": "Ongeldige datum",
|
||||
@@ -79,7 +80,7 @@
|
||||
"map": "Kaart",
|
||||
"metric": "Metrisch",
|
||||
"moderate": "Gemiddeld",
|
||||
"must-be-at-least-8-characters-long": "Moet minstens 8 karakters lang zijn",
|
||||
"must-be-at-least-n-characters-long": "Moet minstens {n} karakters lang zijn",
|
||||
"name": "Naam",
|
||||
"near": "Dichtbij",
|
||||
"new-list": "Nieuwe lijst",
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
"hero_section_1_text": "Oto kila ścieżek które możesz zobaczyć lub możesz przejść do pełnej listy.",
|
||||
"hero_section_1_text_alternative": "Zacznij poprzez zapisanie swojej ostatniej wyprawy.",
|
||||
"hero_section_2_text": "Czy wiesz że, możesz zapisywać nie tylko piesze wycieczki ale także inne kategorie wypraw?",
|
||||
"hungarian": "Język węgierski",
|
||||
"icon": "Ikona",
|
||||
"imperial": "Anglosaskie",
|
||||
"invalid-date": "Nieprawidłowa data",
|
||||
@@ -79,7 +80,7 @@
|
||||
"map": "Mapa",
|
||||
"metric": "Metryczne",
|
||||
"moderate": "Średnia",
|
||||
"must-be-at-least-8-characters-long": "Długość musi wynosić przynajmniej 8 znaków",
|
||||
"must-be-at-least-n-characters-long": "Długość musi wynosić przynajmniej {n} znaków",
|
||||
"name": "Nazwa",
|
||||
"near": "Blisko",
|
||||
"new-list": "Nowa Lista",
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
"hero_section_1_text": "Aqui estão algumas trilhas que você pode gostar. Ou podes ir à lista completa agora.",
|
||||
"hero_section_1_text_alternative": "Comece salvando sua última aventura.",
|
||||
"hero_section_2_text": "Sabias? Você não pode apenas salvá-lo trilhas de caminhada. Há muitas categorias para todas as suas aventuras.",
|
||||
"hungarian": "Húngaro",
|
||||
"icon": "Ícone",
|
||||
"imperial": "Imperial",
|
||||
"invalid-date": "Data inválida",
|
||||
@@ -79,7 +80,7 @@
|
||||
"map": "Mapa",
|
||||
"metric": "Métrica",
|
||||
"moderate": "Moderado",
|
||||
"must-be-at-least-8-characters-long": "Deve ter pelo menos 8 caracteres",
|
||||
"must-be-at-least-n-characters-long": "Deve ter pelo menos {n} caracteres",
|
||||
"name": "Nome",
|
||||
"near": "Próximo",
|
||||
"new-list": "Nova lista",
|
||||
|
||||
@@ -9,7 +9,7 @@ export type User = {
|
||||
password: string,
|
||||
avatar?: string;
|
||||
unit?: "metric" | "imperial";
|
||||
language?: "en" | "de" | "fr" | "nl" | "pl" | "pt";
|
||||
language?: "en" | "de" | "fr" | "hu" | "nl" | "pl" | "pt";
|
||||
location?: { name: string, lat: number, lon: number }
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export async function oauth_login(data: { name: string, code: string, codeVerifi
|
||||
const r = await fetch('/api/v1/auth/oauth', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
})
|
||||
|
||||
if (r.ok) {
|
||||
pb.authStore.loadFromCookie(document.cookie)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
{ text: $_("german"), value: "de" },
|
||||
{ text: $_("english"), value: "en" },
|
||||
{ text: $_("french"), value: "fr" },
|
||||
{ text: $_("hungarian"), value: "hu" },
|
||||
{ text: $_("dutch"), value: "nl" },
|
||||
{ text: $_("polish"), value: "pl" },
|
||||
{ text: $_("portuguese"), value: "pt" },
|
||||
@@ -95,7 +96,7 @@
|
||||
}
|
||||
|
||||
async function handleLanguageSelection(
|
||||
value: "en" | "de" | "fr" | "nl" | "pl" | "pt",
|
||||
value: "en" | "de" | "fr" | "hu" | "nl" | "pl" | "pt",
|
||||
) {
|
||||
locale.set(value);
|
||||
await users_update({
|
||||
|
||||
@@ -20,13 +20,24 @@
|
||||
},
|
||||
validationSchema: object<User>({
|
||||
username: string()
|
||||
.min(
|
||||
3,
|
||||
$_("must-be-at-least-n-characters-long", {
|
||||
values: { n: 3 },
|
||||
}),
|
||||
)
|
||||
.required($_("required"))
|
||||
.matches(/^[\w][\w\.]*$/, { message: $_("invalid-username") }),
|
||||
email: string()
|
||||
.email($_("not-a-valid-email-address"))
|
||||
.required($_("required")),
|
||||
password: string()
|
||||
.min(8, $_("must-be-at-least-8-characters-long"))
|
||||
.min(
|
||||
8,
|
||||
$_("must-be-at-least-n-characters-long", {
|
||||
values: { n: 8 },
|
||||
}),
|
||||
)
|
||||
.required($_("required")),
|
||||
}),
|
||||
onSubmit: async (newUser) => {
|
||||
|
||||
Reference in New Issue
Block a user