adds french & fixes translation issues

This commit is contained in:
Christian Beutel
2024-03-28 14:34:48 +01:00
parent 340a3c7c05
commit 7662234ff4
15 changed files with 335 additions and 42 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { createEventDispatcher } from "svelte";
import { summitLogSchema, type SummitLog } from "$lib/models/summit_log";
import { type SummitLog } from "$lib/models/summit_log";
import { summitLog } from "$lib/stores/summit_log_store";
import { createForm } from "$lib/vendor/svelte-form-lib/index";
import { util } from "$lib/vendor/svelte-form-lib/util";
@@ -9,11 +9,25 @@
import Datepicker from "../base/datepicker.svelte";
import Modal from "../base/modal.svelte";
import TextField from "../base/text_field.svelte";
import { date, object, string } from "yup";
import { parse } from "date-fns";
export let openModal: (() => void) | undefined = undefined;
export let closeModal: (() => void) | undefined = undefined;
const dispatch = createEventDispatcher();
const summitLogSchema = object<SummitLog>({
id: string().optional(),
date: date()
.transform((value, originalValue, context) => {
if (context.isType(value)) return value;
return parse(originalValue, "dd.MM.yyyy", new Date());
})
.required("Required")
.typeError($_("invalid-date")),
text: string().optional(),
});
const { form, errors, handleChange, handleSubmit } = createForm<SummitLog>({
initialValues: $summitLog,
validationSchema: summitLogSchema,

View File

@@ -238,7 +238,7 @@
>
</div>
<hr class="my-4 border-separator" />
<p class="text-sm font-medium pb-4">{$_("completed")}</p>
<p class="text-sm font-medium pb-4">{$_("completion-status")}</p>
<RadioGroup
name="completed"
items={radioGroupItems}

View File

@@ -7,6 +7,7 @@ const defaultLocale = 'en'
register('en', () => import('./locales/en.json'))
register('de', () => import('./locales/de.json'))
register('fr', () => import('./locales/fr.json'))
register('nl', () => import('./locales/nl.json'))
register('pl', () => import('./locales/pl.json'))
register('pt', () => import('./locales/pt.json'))

View File

@@ -7,6 +7,7 @@
"added-trail-to": "Route hinzugefügt zu",
"alphabetical": "Alphabetisch",
"already-account": "Du hast bereits ein Konto?",
"altitude": "",
"avatar": "Avatar",
"basic-info": "Basisinformation",
"cancel": "Abbrechen",
@@ -16,6 +17,7 @@
"change": "Ändern",
"changelog": "Changelog",
"completed": "Abgeschlossen",
"completion-status": "",
"contribute": "Mitwirken",
"create-new-list": "Neue Liste erstellen",
"creation-date": "Erstellungsdatum",
@@ -52,6 +54,7 @@
"explore": "Erkunden",
"explore-some-trails": "Erkunden Sie einige Routen",
"features": "Features",
"french": "",
"german": "Deutsch",
"hero_section_0_text": "Entdecke spannende Routen, speichere deine Favoriten und erlebe die Schönheit der Natur. Finde dein nächstes Abenteuer!",
"hero_section_1_heading": "Hier gibt es noch keine Routen",
@@ -60,6 +63,7 @@
"hero_section_2_text": "Wusstest du schon? Du kannst nicht nur deine Routen speichern. Es gibt viele Kategorien für alle deine Abenteuer.",
"icon": "Icon",
"imperial": "Amerikanisch",
"invalid-date": "",
"invalid-username": "Ungültiger Nutzername",
"language": "Sprache",
"latitude": "Breitengrad",

View File

@@ -7,6 +7,7 @@
"added-trail-to": "Added trail to",
"alphabetical": "Alphabetical",
"already-account": "Already have an account?",
"altitude": "Altitude",
"avatar": "Avatar",
"basic-info": "Basic Info",
"cancel": "Cancel",
@@ -16,6 +17,7 @@
"change": "Change",
"changelog": "Changelog",
"completed": "Completed",
"completion-status": "Completion Status",
"contribute": "Contribute",
"create-new-list": "Create new list",
"creation-date": "Creation date",
@@ -52,6 +54,7 @@
"explore": "Explore",
"explore-some-trails": "Explore some trails",
"features": "Features",
"french": "French",
"german": "German",
"hero_section_0_text": "Explore exciting trails, save your favorites, and experience the beauty of nature. Find your next adventure!",
"hero_section_1_heading": "It seems there are no trails here yet.",
@@ -60,6 +63,7 @@
"hero_section_2_text": "Did you know? You cannot only save you hiking trails. There are many categories for all your adventures.",
"icon": "Icon",
"imperial": "Imperial",
"invalid-date": "Invalid Date",
"invalid-username": "Invalid username",
"language": "Language",
"latitude": "Latitude",

View File

@@ -0,0 +1,115 @@
{
"about": "Informations",
"account-delete-confirm": "Vous êtes sur le point de supprimer votre compte. Toutes vos trails seront également supprimées. Voulez-vous continuer ?",
"contribute": "Contribuer",
"delete-list-confirm": "Voulez-vous vraiment supprimer cette liste ? Les itinéraires de la liste seront toujours disponibles.",
"added-trail-to": "Ajouter un itinéraire à",
"error-creating-user": "Erreur durant la création de l'utilisateur",
"hero_section_0_text": "Explorez des itinéraires passionnants, sauvegardez vos favoris et découvrez la beauté de la nature. Trouvez votre prochaine aventure !",
"add-entry": "Ajouter une entrée",
"add-to-list": "Ajouter à une liste",
"add-waypoint": "Ajouter un point de repère",
"alphabetical": "Alphabétique",
"already-account": "Déjà un compte ?",
"avatar": "Avatar",
"basic-info": "Informations de base",
"cancel": "Annuler",
"categories": "Catégories",
"category": "Catégorie",
"change": "Changement",
"changelog": "Journal des modifications",
"completed": "Compléter",
"create-new-list": "Créer une nouvelle liste",
"creation-date": "Date de création",
"danger-zone": "Zone de danger",
"date": "Date",
"default-location": "Endroit pas défaut",
"delete": "Supprimer",
"delete-account": "Supprimer le compte",
"card": "{n, plural, =1 {Carte} other {Cartes}}",
"delete-trail-confirm": "Voulez-vous vraiment supprimer cet itinéraire ? Cette action ne peut être annulée.",
"hero_section_1_text": "Voici quelques itinéraires qui pourraient vous plaire. Vous pouvez également consulter la liste complète dès maintenant.",
"moderate": "Modérer",
"describe-your-trail": "Décrivez votre itinéraire",
"description": "Description",
"difficulty": "Difficulté",
"difficult": "Difficile",
"directions": "Directions",
"display-as": "Afficher en tant que",
"distance": "Distance",
"documentation": "Documentation",
"download-gpx": "Télécharger le GPX",
"easy": "Facile",
"edit": "Editer",
"edit-entry": "Éditer une entrée",
"edit-list": "Éditer la liste",
"edit-waypoint": "Éditer le point de repère",
"elevation-gain": "Gain d'altitude",
"email": "Email",
"english": "Anglais",
"error-during-login": "Erreur durant la connexion",
"est-duration": "Temps estimé",
"explore": "Explorer",
"features": "Fonctionnalités",
"german": "Allemand",
"hero_section_1_heading": "Il semble qu'il n'y ait pas encore d'itinéraire ici.",
"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.",
"icon": "Icône",
"imperial": "Impérial",
"invalid-username": "Nom d'utilisateur invalide",
"language": "Langue",
"latitude": "Latitude",
"license": "Licence",
"location": "Localisation",
"login": "Connexion",
"logout": "Déconnexion",
"longitude": "Longitude",
"make-one": "Faites-en un !",
"map": "Carte",
"metric": "Métrique",
"list": "{n, plural, =1 {Liste} other {Listes}}",
"make-thumbnail": "Créer une miniature",
"name": "Nom",
"near": "Proche",
"new-list": "Nouvelle liste",
"new-trail": "Nouvel itinéraire",
"no-account": "Pas encore de compte ?",
"password": "Mot de passe",
"photos": "Photos",
"pick-a-trail": "Choisir un itinéraire",
"profile": "Profile",
"public": "Publique",
"register": "S'enregistrer",
"required": "Requis",
"save": "Sauvegarder",
"save-trail": "Sauvegarder l'itinéraire",
"search-cities": "Recherche une ville",
"search-for-trails-places": "Chercher un itinéraire ou un endroit",
"search-trails": "Chercher un itinéraire",
"select-list": "Liste de choix",
"settings": "Paramètres",
"show-on-map": "Voir sur la carte",
"slogan": "Sauvegarder vos aventures !",
"sort": "Trier",
"summit-book": "Livre du sommet",
"text": "Texte",
"trail": "{n, plural, =1 {Itinéraire} other {Itinéraires}}",
"units": "Unités",
"upload-gpx": "Envoyer un GPX",
"username": "Nom d'utilisteur",
"waypoints": "Point de repère",
"welcome_to": "Bienvenue à",
"no-preference": "Pas de préférence",
"no-results": "Pas de résultat",
"not-a-valid-email-address": "Adresse email invalide",
"not-completed": "Pas terminé",
"radius": "Rayon",
"must-be-at-least-8-characters-long": "Doit être composé d'au moins 8 caractères",
"removed-trail-from": "Enlever l'itinéraire de",
"wrong-username-or-password": "Nom d'utilisateur ou mot de passe incorrect",
"entry": "Entrée",
"trails-for-you": "Itinéraire pour vous",
"show-in-overview": "Voir dans l'aperçu",
"explore-some-trails": "Explorer certains itinéraires"
}

View File

@@ -7,6 +7,7 @@
"added-trail-to": "Trail toegevoegd aan",
"alphabetical": "Alfabetisch",
"already-account": "Je hebt al een account?",
"altitude": "",
"avatar": "Avatar",
"basic-info": "Basisinformatie",
"cancel": "Annuleren",
@@ -16,6 +17,7 @@
"change": "Aanpassen",
"changelog": "Changelog",
"completed": "Voltooid",
"completion-status": "",
"contribute": "Bijdragen",
"create-new-list": "Nieuwe lijst aanmaken",
"creation-date": "Aanmaakdatum",
@@ -52,6 +54,7 @@
"explore": "Verkennen",
"explore-some-trails": "Verken enkele routes",
"features": "Features",
"french": "",
"german": "Duits",
"hero_section_0_text": "Verken spannende routes, sla je favorieten op en ervaar de pracht van de natuur. Ontdek je volgende avontuur!",
"hero_section_1_heading": "Hier zijn nog geen routes.",
@@ -60,6 +63,7 @@
"hero_section_2_text": "Wist je dat? Je kan niet alleen wandelroutes opslaan. Er zijn verschillende categorieën voor al je avonturen.",
"icon": "Icoon",
"imperial": "Amerikaans",
"invalid-date": "",
"invalid-username": "Ongeldige gebruikersnaam",
"language": "Taal",
"latitude": "Breedtegraad",

View File

@@ -7,6 +7,7 @@
"added-trail-to": "Dodaj ścieżkę do",
"alphabetical": "Alfabetycznie",
"already-account": "Czy masz już konto?",
"altitude": "",
"avatar": "Awatar",
"basic-info": "Podstawowe informacje",
"cancel": "Anuluj",
@@ -16,6 +17,7 @@
"change": "Zmień",
"changelog": "Dziennik zmian",
"completed": "Zakończono",
"completion-status": "",
"contribute": "Kontrybuuj",
"create-new-list": "Stwórz nową listę",
"creation-date": "Data stworzenia",
@@ -52,6 +54,7 @@
"explore": "Eksploruj",
"explore-some-trails": "Eksploruj różne ścieżki",
"features": "Funkcje",
"french": "",
"german": "Niemiecki",
"hero_section_0_text": "Eksploruj ekscytujące szlaki, zapisz swoje ulubione, doświadcz piękna naturalnego świata. Znajdź swoją następną przygodę!",
"hero_section_1_heading": "Wygląda na to że nie ma tutaj ścieżek.",
@@ -60,6 +63,7 @@
"hero_section_2_text": "Czy wiesz że, możesz zapisywać nie tylko piesze wycieczki ale także inne kategorie wypraw?",
"icon": "Ikona",
"imperial": "Anglosaskie",
"invalid-date": "",
"invalid-username": "Błędna nazwa użytkownika",
"language": "Język",
"latitude": "Szerokość",

View File

@@ -7,6 +7,7 @@
"added-trail-to": "Trilha adicionada para",
"alphabetical": "Alfabético",
"already-account": "Já tem uma conta?",
"altitude": "",
"avatar": "Avatar",
"basic-info": "Informações básicas",
"cancel": "Cancelar",
@@ -16,6 +17,7 @@
"change": "Alterar",
"changelog": "Registo de alterações",
"completed": "Completada",
"completion-status": "",
"contribute": "Contribuir",
"create-new-list": "Criar nova lista",
"creation-date": "Data de criação",
@@ -52,6 +54,7 @@
"explore": "Explorar",
"explore-some-trails": "Explore algumas trilhas",
"features": "Características",
"french": "",
"german": "Alemão",
"hero_section_0_text": "Explore trilhas emocionantes, salve seus favoritos e experimente a beleza da natureza. Encontre sua próxima aventura!",
"hero_section_1_heading": "Parece que ainda não há trilhas aqui.",
@@ -60,6 +63,7 @@
"hero_section_2_text": "Sabias? Você não pode apenas salvá-lo trilhas de caminhada. Há muitas categorias para todas as suas aventuras.",
"icon": "Ícone",
"imperial": "Imperial",
"invalid-date": "",
"invalid-username": "Nome de usuário inválido",
"language": "Língua",
"latitude": "Latitude",

View File

@@ -1,5 +1,3 @@
import { parse } from "date-fns";
import { date, number, object, string } from "yup";
class SummitLog {
id?: string;
@@ -13,14 +11,5 @@ class SummitLog {
}
}
const summitLogSchema = object<SummitLog>({
id: string().optional(),
date: date().transform((value, originalValue, context) => {
if (context.isType(value)) return value;
return parse(originalValue, 'dd.MM.yyyy', new Date());
}).required('Required').typeError('Invalid Date'),
text: string().optional(),
});
export { SummitLog, summitLogSchema }
export { SummitLog };

View File

@@ -9,7 +9,7 @@ export type User = {
password: string,
avatar?: string;
unit?: "metric" | "imperial";
language?: "en" | "de" | "nl" | "pl" | "pt";
language?: "en" | "de" | "fr" | "nl" | "pl" | "pt";
location?: { name: string, lat: number, lon: number }
}

View File

@@ -13,7 +13,7 @@ export async function PUT(event: RequestEvent) {
}
let trail: Trail;
try {
trail = gpx2trail(gpx);
trail = await gpx2trail(gpx);
} catch (e: any) {
throw new ClientResponseError({ status: 400, response: { message: "Invalid GPX file" } })
}

View File

@@ -24,6 +24,7 @@
const languages: SelectItem[] = [
{ text: $_("german"), value: "de" },
{ text: $_("english"), value: "en" },
{ text: $_("french"), value: "fr" },
{ text: $_("dutch"), value: "nl" },
{ text: $_("polish"), value: "pl" },
{ text: $_("portuguese"), value: "pt" },
@@ -94,7 +95,7 @@
}
async function handleLanguageSelection(
value: "en" | "de" | "nl" | "pl" | "pt",
value: "en" | "de" | "fr" | "nl" | "pl" | "pt",
) {
locale.set(value);
await users_update({