mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 14:59:36 +02:00
Add language selection and share localization for multiple languages
This commit is contained in:
parent
9ac4a8f4e9
commit
9c6e11b16d
10 changed files with 266 additions and 29 deletions
|
@ -252,15 +252,20 @@
|
|||
<button formaction="/?/setTheme&theme=aqua"
|
||||
>{$t('navbar.themes.aqua')}<Water class="w-6 h-6" /></button
|
||||
>
|
||||
<form method="POST" use:enhance>
|
||||
<select class="select" on:change={submitLocaleChange} bind:value={$locale}>
|
||||
{#each $locales as loc}
|
||||
<option value={loc}>{loc}</option>
|
||||
{/each}
|
||||
</select>
|
||||
<input type="hidden" name="locale" value={$locale} />
|
||||
</form>
|
||||
</li>
|
||||
<p class="font-bold m-4 text-lg text-center">{$t('navbar.language_selection')}</p>
|
||||
<form method="POST" use:enhance>
|
||||
<select
|
||||
class="select select-bordered w-full max-w-xs bg-base-100 text-base-content"
|
||||
on:change={submitLocaleChange}
|
||||
bind:value={$locale}
|
||||
>
|
||||
{#each $locales as loc}
|
||||
<option value={loc} class="text-base-content">{$t(`languages.${loc}`)}</option>
|
||||
{/each}
|
||||
</select>
|
||||
<input type="hidden" name="locale" value={$locale} />
|
||||
</form>
|
||||
</form>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import UserCard from './UserCard.svelte';
|
||||
import { addToast } from '$lib/toasts';
|
||||
let modal: HTMLDialogElement;
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
export let collection: Collection;
|
||||
|
||||
|
@ -25,7 +26,10 @@
|
|||
sharedWithUsers = sharedWithUsers.concat(user);
|
||||
collection.shared_with.push(user.uuid);
|
||||
notSharedWithUsers = notSharedWithUsers.filter((u) => u.uuid !== user.uuid);
|
||||
addToast('success', `Shared ${collection.name} with ${user.first_name} ${user.last_name}`);
|
||||
addToast(
|
||||
'success',
|
||||
`${$t('share.shared')} ${collection.name} ${$t('share.with')} ${user.first_name} ${user.last_name}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +44,10 @@
|
|||
notSharedWithUsers = notSharedWithUsers.concat(user);
|
||||
collection.shared_with = collection.shared_with.filter((u) => u !== user.uuid);
|
||||
sharedWithUsers = sharedWithUsers.filter((u) => u.uuid !== user.uuid);
|
||||
addToast('success', `Unshared ${collection.name} with ${user.first_name} ${user.last_name}`);
|
||||
addToast(
|
||||
'success',
|
||||
`${$t('share.unshared')} ${collection.name} ${$t('share.with')} ${user.first_name} ${user.last_name}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,10 +82,10 @@
|
|||
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<div class="modal-box w-11/12 max-w-5xl" role="dialog" on:keydown={handleKeydown} tabindex="0">
|
||||
<h3 class="font-bold text-lg">Share {collection.name}</h3>
|
||||
<p class="py-1">Share this collection with other users.</p>
|
||||
<h3 class="font-bold text-lg">{$t('adventures.share')} {collection.name}</h3>
|
||||
<p class="py-1">{$t('share.share_desc')}</p>
|
||||
<div class="divider"></div>
|
||||
<h3 class="font-bold text-md">Shared With</h3>
|
||||
<h3 class="font-bold text-md">{$t('share.shared_with')}</h3>
|
||||
<ul>
|
||||
{#each sharedWithUsers as user}
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
|
@ -92,11 +99,11 @@
|
|||
</div>
|
||||
{/each}
|
||||
{#if sharedWithUsers.length === 0}
|
||||
<p class="text-neutral-content">No users shared with</p>
|
||||
<p class="text-neutral-content">{$t('share.no_users_shared')}</p>
|
||||
{/if}
|
||||
</ul>
|
||||
<div class="divider"></div>
|
||||
<h3 class="font-bold text-md">Not Shared With</h3>
|
||||
<h3 class="font-bold text-md">{$t('share.not_shared_with')}</h3>
|
||||
<ul>
|
||||
{#each notSharedWithUsers as user}
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
|
@ -110,9 +117,9 @@
|
|||
</div>
|
||||
{/each}
|
||||
{#if notSharedWithUsers.length === 0}
|
||||
<p class="text-neutral-content">No users not shared with</p>
|
||||
<p class="text-neutral-content">{$t('share.no_users_shared')}</p>
|
||||
{/if}
|
||||
</ul>
|
||||
<button class="btn btn-primary mt-4" on:click={close}>Close</button>
|
||||
<button class="btn btn-primary mt-4" on:click={close}>{$t('about.close')}</button>
|
||||
</div>
|
||||
</dialog>
|
||||
|
|
|
@ -229,7 +229,8 @@
|
|||
"users": "Benutzer",
|
||||
"worldtravel": "Weltreisen",
|
||||
"my_tags": "Meine Tags",
|
||||
"tag": "Etikett"
|
||||
"tag": "Etikett",
|
||||
"language_selection": "Sprache"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Passwort bestätigen",
|
||||
|
@ -365,5 +366,24 @@
|
|||
"map_options": "Kartenoptionen",
|
||||
"show_visited_regions": "Besuchte Regionen anzeigen",
|
||||
"view_details": "Details anzeigen"
|
||||
},
|
||||
"languages": {
|
||||
"de": "Deutsch",
|
||||
"en": "Englisch",
|
||||
"es": "Spanisch",
|
||||
"fr": "Französisch",
|
||||
"it": "Italienisch",
|
||||
"nl": "Niederländisch",
|
||||
"sv": "Schwedisch",
|
||||
"zh": "chinesisch"
|
||||
},
|
||||
"share": {
|
||||
"no_users_shared": "Keine Benutzer geteilt mit",
|
||||
"not_shared_with": "Nicht geteilt mit",
|
||||
"share_desc": "Teilen Sie diese Sammlung mit anderen Benutzern.",
|
||||
"shared": "Geteilt",
|
||||
"shared_with": "Geteilt mit",
|
||||
"unshared": "Nicht geteilt",
|
||||
"with": "mit"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"about": "About AdventureLog",
|
||||
"documentation": "Documentation",
|
||||
"discord": "Discord",
|
||||
"language_selection": "Language",
|
||||
"theme_selection": "Theme Selection",
|
||||
"themes": {
|
||||
"light": "Light",
|
||||
|
@ -365,5 +366,24 @@
|
|||
"add_adventure_at_marker": "Add New Adventure at Marker",
|
||||
"clear_marker": "Clear Marker",
|
||||
"add_adventure": "Add New Adventure"
|
||||
},
|
||||
"share": {
|
||||
"shared": "Shared",
|
||||
"with": "with",
|
||||
"unshared": "Unshared",
|
||||
"share_desc": "Share this collection with other users.",
|
||||
"shared_with": "Shared With",
|
||||
"no_users_shared": "No users shared with",
|
||||
"not_shared_with": "Not Shared With"
|
||||
},
|
||||
"languages": {
|
||||
"en": "English",
|
||||
"de": "German",
|
||||
"es": "Spanish",
|
||||
"fr": "French",
|
||||
"it": "Italian",
|
||||
"nl": "Dutch",
|
||||
"sv": "Swedish",
|
||||
"zh": "Chinese"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
"aqua": "Aqua"
|
||||
},
|
||||
"my_tags": "Mis etiquetas",
|
||||
"tag": "Etiqueta"
|
||||
"tag": "Etiqueta",
|
||||
"language_selection": "Idioma"
|
||||
},
|
||||
"about": {
|
||||
"about": "Acerca de",
|
||||
|
@ -365,5 +366,24 @@
|
|||
"map_options": "Opciones de mapa",
|
||||
"show_visited_regions": "Mostrar regiones visitadas",
|
||||
"view_details": "Ver detalles"
|
||||
},
|
||||
"share": {
|
||||
"no_users_shared": "Ningún usuario compartió con",
|
||||
"not_shared_with": "No compartido con",
|
||||
"share_desc": "Comparte esta colección con otros usuarios.",
|
||||
"shared": "Compartido",
|
||||
"shared_with": "Compartido con",
|
||||
"unshared": "Incompartible",
|
||||
"with": "con"
|
||||
},
|
||||
"languages": {
|
||||
"de": "Alemán",
|
||||
"en": "Inglés",
|
||||
"es": "Español",
|
||||
"fr": "Francés",
|
||||
"it": "italiano",
|
||||
"nl": "Holandés",
|
||||
"sv": "sueco",
|
||||
"zh": "Chino"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,9 @@
|
|||
"transportations": "Transports",
|
||||
"visit_link": "Visitez le lien",
|
||||
"checklist": "Liste de contrôle",
|
||||
"day": "Jour"
|
||||
"day": "Jour",
|
||||
"add_a_tag": "Ajouter une balise",
|
||||
"tags": "Balises"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Découvrez, planifiez et explorez en toute simplicité",
|
||||
|
@ -225,7 +227,10 @@
|
|||
"dark": "Sombre"
|
||||
},
|
||||
"users": "Utilisateurs",
|
||||
"worldtravel": "Voyage dans le monde"
|
||||
"worldtravel": "Voyage dans le monde",
|
||||
"my_tags": "Mes balises",
|
||||
"tag": "Étiqueter",
|
||||
"language_selection": "Langue"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Confirmez le mot de passe",
|
||||
|
@ -352,5 +357,33 @@
|
|||
"adventurelog_results": "Résultats du journal d'aventure",
|
||||
"online_results": "Résultats en ligne",
|
||||
"public_adventures": "Aventures publiques"
|
||||
},
|
||||
"map": {
|
||||
"add_adventure": "Ajouter une nouvelle aventure",
|
||||
"add_adventure_at_marker": "Ajouter une nouvelle aventure au marqueur",
|
||||
"adventure_map": "Carte d'aventure",
|
||||
"clear_marker": "Effacer le marqueur",
|
||||
"map_options": "Options de la carte",
|
||||
"show_visited_regions": "Afficher les régions visitées",
|
||||
"view_details": "Afficher les détails"
|
||||
},
|
||||
"languages": {
|
||||
"de": "Allemand",
|
||||
"en": "Anglais",
|
||||
"es": "Espagnol",
|
||||
"fr": "Français",
|
||||
"it": "italien",
|
||||
"nl": "Néerlandais",
|
||||
"sv": "suédois",
|
||||
"zh": "Chinois"
|
||||
},
|
||||
"share": {
|
||||
"no_users_shared": "Aucun utilisateur partagé avec",
|
||||
"not_shared_with": "Non partagé avec",
|
||||
"share_desc": "Partagez cette collection avec d'autres utilisateurs.",
|
||||
"shared": "Commun",
|
||||
"shared_with": "Partagé avec",
|
||||
"unshared": "Non partagé",
|
||||
"with": "avec"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,9 @@
|
|||
"transportation": "Trasporti",
|
||||
"transportations": "Trasporti",
|
||||
"visit_link": "Visita il collegamento",
|
||||
"day": "Giorno"
|
||||
"day": "Giorno",
|
||||
"add_a_tag": "Aggiungi un'etichetta",
|
||||
"tags": "Tag"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Scopri, pianifica ed esplora con facilità",
|
||||
|
@ -225,7 +227,10 @@
|
|||
"night": "Notte"
|
||||
},
|
||||
"users": "Utenti",
|
||||
"worldtravel": "Viaggio nel mondo"
|
||||
"worldtravel": "Viaggio nel mondo",
|
||||
"my_tags": "I miei tag",
|
||||
"tag": "Etichetta",
|
||||
"language_selection": "Lingua"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Conferma password",
|
||||
|
@ -352,5 +357,33 @@
|
|||
"adventurelog_results": "Risultati di AdventureLog",
|
||||
"online_results": "Risultati in linea",
|
||||
"public_adventures": "Avventure pubbliche"
|
||||
},
|
||||
"map": {
|
||||
"add_adventure": "Aggiungi nuova avventura",
|
||||
"add_adventure_at_marker": "Aggiungi nuova avventura a Marker",
|
||||
"adventure_map": "Mappa dell'avventura",
|
||||
"clear_marker": "Cancella indicatore",
|
||||
"map_options": "Opzioni della mappa",
|
||||
"show_visited_regions": "Mostra regioni visitate",
|
||||
"view_details": "Visualizza dettagli"
|
||||
},
|
||||
"languages": {
|
||||
"de": "tedesco",
|
||||
"en": "Inglese",
|
||||
"es": "spagnolo",
|
||||
"fr": "francese",
|
||||
"it": "Italiano",
|
||||
"nl": "Olandese",
|
||||
"sv": "svedese",
|
||||
"zh": "cinese"
|
||||
},
|
||||
"share": {
|
||||
"no_users_shared": "Nessun utente condiviso con",
|
||||
"not_shared_with": "Non condiviso con",
|
||||
"share_desc": "Condividi questa raccolta con altri utenti.",
|
||||
"shared": "Condiviso",
|
||||
"shared_with": "Condiviso con",
|
||||
"unshared": "Non condiviso",
|
||||
"with": "con"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,9 @@
|
|||
"transportation": "Vervoer",
|
||||
"transportations": "Transporten",
|
||||
"visit_link": "Bezoek Link",
|
||||
"day": "Dag"
|
||||
"day": "Dag",
|
||||
"add_a_tag": "Voeg een label toe",
|
||||
"tags": "Labels"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Ontdek, plan en verken met gemak",
|
||||
|
@ -225,7 +227,10 @@
|
|||
"night": "Nacht"
|
||||
},
|
||||
"users": "Gebruikers",
|
||||
"worldtravel": "Wereldreizen"
|
||||
"worldtravel": "Wereldreizen",
|
||||
"my_tags": "Mijn tags",
|
||||
"tag": "Label",
|
||||
"language_selection": "Taal"
|
||||
},
|
||||
"auth": {
|
||||
"confirm_password": "Bevestig wachtwoord",
|
||||
|
@ -352,5 +357,33 @@
|
|||
"adventurelog_results": "AdventureLog-resultaten",
|
||||
"online_results": "Online resultaten",
|
||||
"public_adventures": "Openbare avonturen"
|
||||
},
|
||||
"map": {
|
||||
"add_adventure": "Voeg nieuw avontuur toe",
|
||||
"add_adventure_at_marker": "Voeg een nieuw avontuur toe bij Marker",
|
||||
"adventure_map": "Avonturenkaart",
|
||||
"clear_marker": "Duidelijke markering",
|
||||
"map_options": "Kaartopties",
|
||||
"show_visited_regions": "Toon bezochte regio's",
|
||||
"view_details": "Details bekijken"
|
||||
},
|
||||
"languages": {
|
||||
"de": "Duits",
|
||||
"en": "Engels",
|
||||
"es": "Spaans",
|
||||
"fr": "Frans",
|
||||
"it": "Italiaans",
|
||||
"nl": "Nederlands",
|
||||
"sv": "Zweeds",
|
||||
"zh": "Chinese"
|
||||
},
|
||||
"share": {
|
||||
"no_users_shared": "Er zijn geen gebruikers gedeeld",
|
||||
"not_shared_with": "Niet gedeeld met",
|
||||
"share_desc": "Deel deze verzameling met andere gebruikers.",
|
||||
"shared": "Gedeeld",
|
||||
"shared_with": "Gedeeld met",
|
||||
"unshared": "Niet gedeeld",
|
||||
"with": "met"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,9 @@
|
|||
"transportation": "Transport",
|
||||
"transportations": "Transporter",
|
||||
"visit_link": "Besök länken",
|
||||
"day": "Dag"
|
||||
"day": "Dag",
|
||||
"add_a_tag": "Lägg till en tagg",
|
||||
"tags": "Taggar"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "Upptäck, planera och utforska med lätthet",
|
||||
|
@ -225,7 +227,10 @@
|
|||
"night": "Natt"
|
||||
},
|
||||
"users": "Användare",
|
||||
"worldtravel": "Världsresor"
|
||||
"worldtravel": "Världsresor",
|
||||
"my_tags": "Mina taggar",
|
||||
"tag": "Märka",
|
||||
"language_selection": "Språk"
|
||||
},
|
||||
"worldtravel": {
|
||||
"all": "Alla",
|
||||
|
@ -352,5 +357,33 @@
|
|||
"adventurelog_results": "AdventureLog-resultat",
|
||||
"online_results": "Online resultat",
|
||||
"public_adventures": "Offentliga äventyr"
|
||||
},
|
||||
"map": {
|
||||
"add_adventure": "Lägg till nytt äventyr",
|
||||
"add_adventure_at_marker": "Lägg till nytt äventyr vid Marker",
|
||||
"adventure_map": "Äventyrskarta",
|
||||
"clear_marker": "Rensa markör",
|
||||
"map_options": "Kartalternativ",
|
||||
"show_visited_regions": "Visa besökta regioner",
|
||||
"view_details": "Visa detaljer"
|
||||
},
|
||||
"languages": {
|
||||
"de": "tyska",
|
||||
"en": "engelska",
|
||||
"es": "spanska",
|
||||
"fr": "franska",
|
||||
"it": "italienska",
|
||||
"nl": "holländska",
|
||||
"sv": "svenska",
|
||||
"zh": "kinesiska"
|
||||
},
|
||||
"share": {
|
||||
"no_users_shared": "Inga användare delas med",
|
||||
"not_shared_with": "Inte delad med",
|
||||
"share_desc": "Dela den här samlingen med andra användare.",
|
||||
"shared": "Delad",
|
||||
"shared_with": "Delas med",
|
||||
"unshared": "Odelat",
|
||||
"with": "med"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,9 @@
|
|||
"transportation": "运输",
|
||||
"transportations": "交通",
|
||||
"visit_link": "访问链接",
|
||||
"day": "天"
|
||||
"day": "天",
|
||||
"add_a_tag": "添加标签",
|
||||
"tags": "标签"
|
||||
},
|
||||
"home": {
|
||||
"desc_1": "轻松发现、规划和探索",
|
||||
|
@ -225,7 +227,10 @@
|
|||
"night": "夜晚"
|
||||
},
|
||||
"users": "用户",
|
||||
"worldtravel": "环球旅行"
|
||||
"worldtravel": "环球旅行",
|
||||
"my_tags": "我的标签",
|
||||
"tag": "标签",
|
||||
"language_selection": "语言"
|
||||
},
|
||||
"auth": {
|
||||
"forgot_password": "忘记密码?",
|
||||
|
@ -352,5 +357,33 @@
|
|||
"adventurelog_results": "冒险日志结果",
|
||||
"online_results": "在线结果",
|
||||
"public_adventures": "公共冒险"
|
||||
},
|
||||
"map": {
|
||||
"add_adventure": "添加新冒险",
|
||||
"add_adventure_at_marker": "在标记处添加新冒险",
|
||||
"adventure_map": "冒险地图",
|
||||
"clear_marker": "清除标记",
|
||||
"map_options": "地图选项",
|
||||
"show_visited_regions": "显示访问过的地区",
|
||||
"view_details": "查看详情"
|
||||
},
|
||||
"languages": {
|
||||
"de": "德语",
|
||||
"en": "英语",
|
||||
"es": "西班牙语",
|
||||
"fr": "法语",
|
||||
"it": "意大利语",
|
||||
"nl": "荷兰语",
|
||||
"sv": "瑞典",
|
||||
"zh": "中国人"
|
||||
},
|
||||
"share": {
|
||||
"no_users_shared": "没有与之共享的用户",
|
||||
"not_shared_with": "不与共享",
|
||||
"share_desc": "与其他用户分享此收藏。",
|
||||
"shared": "共享",
|
||||
"shared_with": "共享对象",
|
||||
"unshared": "未共享",
|
||||
"with": "和"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue