1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 06:49:37 +02:00

Add internationalization support for profile and shared collections; update translations in multiple languages

This commit is contained in:
Sean Morley 2024-11-05 14:40:32 -05:00
parent bcba4f4425
commit c7207ccf52
11 changed files with 93 additions and 18 deletions

View file

@ -119,7 +119,7 @@
</div>
<div class="mb-2">
<label for="description"
>$t('adventures.description')<iconify-icon
>{$t('adventures.description')}<iconify-icon
icon="mdi:notebook"
class="text-lg ml-1 -mb-0.5"
></iconify-icon></label

View file

@ -388,6 +388,15 @@
"shared": "Geteilt",
"shared_with": "Geteilt mit",
"unshared": "Nicht geteilt",
"with": "mit"
"with": "mit",
"go_to_settings": "Gehen Sie zu den Einstellungen",
"no_shared_found": "Es wurden keine Sammlungen gefunden, die mit Ihnen geteilt wurden.",
"set_public": "Damit Benutzer Inhalte mit Ihnen teilen können, muss Ihr Profil auf „Öffentlich“ eingestellt sein."
},
"profile": {
"member_since": "Mitglied seit",
"user_stats": "Benutzerstatistiken",
"visited_countries": "Besuchte Länder",
"visited_regions": "Besuchte Regionen"
}
}

View file

@ -378,7 +378,10 @@
"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"
"not_shared_with": "Not Shared With",
"no_shared_found": "No collections found that are shared with you.",
"set_public": "In order to allow users to share with you, you need your profile set to public.",
"go_to_settings": "Go to settings"
},
"languages": {
"en": "English",
@ -389,5 +392,11 @@
"nl": "Dutch",
"sv": "Swedish",
"zh": "Chinese"
},
"profile": {
"member_since": "Member since",
"user_stats": "User Stats",
"visited_countries": "Visited Countries",
"visited_regions": "Visited Regions"
}
}

View file

@ -378,7 +378,10 @@
"shared": "Compartido",
"shared_with": "Compartido con",
"unshared": "Incompartible",
"with": "con"
"with": "con",
"go_to_settings": "Ir a configuración",
"no_shared_found": "No se encontraron colecciones que se compartan contigo.",
"set_public": "Para permitir que los usuarios compartan contenido con usted, necesita que su perfil esté configurado como público."
},
"languages": {
"de": "Alemán",
@ -389,5 +392,11 @@
"nl": "Holandés",
"sv": "sueco",
"zh": "Chino"
},
"profile": {
"member_since": "Miembro desde",
"user_stats": "Estadísticas de usuario",
"visited_countries": "Países visitados",
"visited_regions": "Regiones visitadas"
}
}

View file

@ -388,6 +388,15 @@
"shared": "Commun",
"shared_with": "Partagé avec",
"unshared": "Non partagé",
"with": "avec"
"with": "avec",
"go_to_settings": "Allez dans les paramètres",
"no_shared_found": "Aucune collection trouvée partagée avec vous.",
"set_public": "Afin de permettre aux utilisateurs de partager avec vous, vous devez définir votre profil comme public."
},
"profile": {
"member_since": "Membre depuis",
"user_stats": "Statistiques des utilisateurs",
"visited_countries": "Pays visités",
"visited_regions": "Régions visitées"
}
}

View file

@ -388,6 +388,15 @@
"shared": "Condiviso",
"shared_with": "Condiviso con",
"unshared": "Non condiviso",
"with": "con"
"with": "con",
"go_to_settings": "Vai alle impostazioni",
"no_shared_found": "Nessuna raccolta trovata condivisa con te.",
"set_public": "Per consentire agli utenti di condividere con te, è necessario che il tuo profilo sia impostato su pubblico."
},
"profile": {
"member_since": "Membro da allora",
"user_stats": "Statistiche utente",
"visited_countries": "Paesi visitati",
"visited_regions": "Regioni visitate"
}
}

View file

@ -388,6 +388,15 @@
"shared": "Gedeeld",
"shared_with": "Gedeeld met",
"unshared": "Niet gedeeld",
"with": "met"
"with": "met",
"go_to_settings": "Ga naar instellingen",
"no_shared_found": "Er zijn geen collecties gevonden die met u zijn gedeeld.",
"set_public": "Om ervoor te zorgen dat gebruikers met u kunnen delen, moet uw profiel op openbaar zijn ingesteld."
},
"profile": {
"member_since": "Lid sinds",
"user_stats": "Gebruikersstatistieken",
"visited_countries": "Bezochte landen",
"visited_regions": "Bezochte regio's"
}
}

View file

@ -388,6 +388,15 @@
"shared": "Delad",
"shared_with": "Delas med",
"unshared": "Odelat",
"with": "med"
"with": "med",
"go_to_settings": "Gå till inställningar",
"no_shared_found": "Inga samlingar hittades som delas med dig.",
"set_public": "För att tillåta användare att dela med dig måste du ha din profil inställd på offentlig."
},
"profile": {
"member_since": "Medlem sedan dess",
"user_stats": "Användarstatistik",
"visited_countries": "Besökta länder",
"visited_regions": "Besökte regioner"
}
}

View file

@ -388,6 +388,15 @@
"shared": "共享",
"shared_with": "共享对象",
"unshared": "未共享",
"with": "和"
"with": "和",
"go_to_settings": "前往设置",
"no_shared_found": "未找到与您共享的集合。",
"set_public": "为了允许用户与您共享,您需要将您的个人资料设置为公开。"
},
"profile": {
"member_since": "会员自",
"user_stats": "用户统计",
"visited_countries": "访问过的国家",
"visited_regions": "访问地区"
}
}

View file

@ -1,5 +1,6 @@
<script lang="ts">
export let data;
import { t } from 'svelte-i18n';
let stats: {
country_count: number;
@ -36,7 +37,7 @@
<p class="text-center text-lg mt-2">{data.user.username}</p>
{#if data.user && data.user.date_joined}
<p class="ml-1 text-lg text-center mt-4">Member Since</p>
<p class="ml-1 text-lg text-center mt-4">{$t('profile.member_since')}</p>
<div class="flex items-center justify-center text-center">
<iconify-icon icon="mdi:calendar" class="text-2xl"></iconify-icon>
<p class="ml-1 text-xl">
@ -49,23 +50,23 @@
<!-- divider -->
<div class="divider pr-8 pl-8"></div>
<h1 class="text-center text-2xl font-bold mt-8 mb-2">User Stats</h1>
<h1 class="text-center text-2xl font-bold mt-8 mb-2">{$t('profile.user_stats')}</h1>
<div class="flex justify-center items-center">
<div class="stats stats-vertical lg:stats-horizontal shadow bg-base-200">
<div class="stat">
<div class="stat-title">Adventures</div>
<div class="stat-title">{$t('navbar.adventures')}</div>
<div class="stat-value text-center">{stats.adventure_count}</div>
<!-- <div class="stat-desc">Jan 1st - Feb 1st</div> -->
</div>
<div class="stat">
<div class="stat-title">Collections</div>
<div class="stat-title">{$t('navbar.collections')}</div>
<div class="stat-value text-center">{stats.trips_count}</div>
<!-- <div class="stat-desc">↘︎ 90 (14%)</div> -->
</div>
<div class="stat">
<div class="stat-title">Visited Countries</div>
<div class="stat-title">{$t('profile.visited_countries')}</div>
<div class="stat-value text-center">
{Math.round((stats.country_count / stats.total_countries) * 100)}%
</div>
@ -75,7 +76,7 @@
</div>
<div class="stat">
<div class="stat-title">Visited Regions</div>
<div class="stat-title">{$t('profile.visited_regions')}</div>
<div class="stat-value text-center">
{Math.round((stats.visited_region_count / stats.total_regions) * 100)}%
</div>

View file

@ -3,6 +3,7 @@
import CollectionCard from '$lib/components/CollectionCard.svelte';
import type { Collection } from '$lib/types';
import type { PageData } from './$types';
import { t } from 'svelte-i18n';
export let data: PageData;
console.log(data);
@ -17,10 +18,11 @@
</div>
{:else}
<p class="text-center font-semibold text-xl mt-6">
No collections found that are shared with you.
{$t('share.no_shared_found')}
{#if data.user && !data.user?.public_profile}
<p>In order to allow users to share with you, you need your profile set to public.</p>
<button class="btn btn-neutral mt-4" on:click={() => goto('/settings')}>Go to Settings</button
<p>{$t('share.set_public')}</p>
<button class="btn btn-neutral mt-4" on:click={() => goto('/settings')}
>{$t('share.go_to_settings')}</button
>
{/if}
</p>