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

Add additional localization strings for itinerary features in Polish, Swedish, and Chinese

- Added "additional_info", "invalid_date_range", "sunrise_sunset", and "timezone" keys to pl.json, sv.json, and zh.json.
- Updated existing strings for consistency across languages.
This commit is contained in:
Sean Morley 2025-05-09 15:59:48 -04:00
parent 311e2847cb
commit 3caebd37dd
13 changed files with 771 additions and 707 deletions

View file

@ -56,11 +56,20 @@
}).localDate; }).localDate;
}); });
if (collection && collection.start_date && collection.end_date) { // Set the full date range for constraining purposes
$: if (collection && collection.start_date && collection.end_date) {
fullStartDate = `${collection.start_date}T00:00`; fullStartDate = `${collection.start_date}T00:00`;
fullEndDate = `${collection.end_date}T23:59`; fullEndDate = `${collection.end_date}T23:59`;
} }
// Get constraint dates in the right format based on allDay setting
$: constraintStartDate = allDay
? fullStartDate
? fullStartDate.split('T')[0]
: ''
: fullStartDate;
$: constraintEndDate = allDay ? (fullEndDate ? fullEndDate.split('T')[0] : '') : fullEndDate;
// Update local display dates whenever timezone or UTC dates change // Update local display dates whenever timezone or UTC dates change
$: if (!isEditing) { $: if (!isEditing) {
if (allDay) { if (allDay) {
@ -109,51 +118,69 @@
<TimezoneSelector bind:selectedTimezone /> <TimezoneSelector bind:selectedTimezone />
</div> </div>
<span class="label-text">{$t('adventures.all_day')}</span> <div class="rounded-xl border border-base-300 bg-base-100 p-4 space-y-4 shadow-sm">
<input <!-- Group Header -->
type="checkbox" <h3 class="text-md font-semibold">{$t('navbar.settings')}</h3>
class="toggle toggle-primary"
id="constrain_dates" <!-- All Day Toggle -->
name="constrain_dates" <div class="flex justify-between items-center">
bind:checked={allDay} <span class="text-sm">{$t('adventures.all_day')}</span>
on:change={() => { <input
// clear local dates when toggling all day type="checkbox"
if (allDay) { class="toggle toggle-primary"
localStartDate = localStartDate.split('T')[0]; id="all_day"
localEndDate = localEndDate.split('T')[0]; name="all_day"
} else { bind:checked={allDay}
localStartDate = localStartDate + 'T00:00'; on:change={() => {
localEndDate = localEndDate + 'T23:59'; if (allDay) {
} localStartDate = localStartDate.split('T')[0];
// Update UTC dates when toggling all day localEndDate = localEndDate.split('T')[0];
utcStartDate = updateUTCDate({ } else {
localDate: localStartDate, localStartDate = localStartDate + 'T00:00';
timezone: selectedTimezone, localEndDate = localEndDate + 'T23:59';
allDay }
}).utcDate; utcStartDate = updateUTCDate({
utcEndDate = updateUTCDate({ localDate: localStartDate,
localDate: localEndDate, timezone: selectedTimezone,
timezone: selectedTimezone, allDay
allDay }).utcDate;
}).utcDate; utcEndDate = updateUTCDate({
// Update local dates when toggling all day localDate: localEndDate,
localStartDate = updateLocalDate({ timezone: selectedTimezone,
utcDate: utcStartDate, allDay
timezone: selectedTimezone }).utcDate;
}).localDate; localStartDate = updateLocalDate({
localEndDate = updateLocalDate({ utcDate: utcStartDate,
utcDate: utcEndDate, timezone: selectedTimezone
timezone: selectedTimezone }).localDate;
}).localDate; localEndDate = updateLocalDate({
}} utcDate: utcEndDate,
/> timezone: selectedTimezone
<!-- All Day Event Checkbox --> }).localDate;
}}
/>
</div>
<!-- Constrain Dates Toggle -->
{#if collection?.start_date && collection?.end_date}
<div class="flex justify-between items-center">
<span class="text-sm">{$t('adventures.date_constrain')}</span>
<input
type="checkbox"
id="constrain_dates"
name="constrain_dates"
class="toggle toggle-primary"
on:change={() => (constrainDates = !constrainDates)}
/>
</div>
{/if}
</div>
<!-- Dates Input Section --> <!-- Dates Input Section -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Start Date --> <!-- Start Date -->
<div class="flex flex-col space-y-2"> <div class="space-y-2">
<label for="date" class="font-medium"> <label for="date" class="text-sm font-medium">
{$t('adventures.start_date')} {$t('adventures.start_date')}
</label> </label>
@ -164,8 +191,8 @@
name="date" name="date"
bind:value={localStartDate} bind:value={localStartDate}
on:change={handleLocalDateChange} on:change={handleLocalDateChange}
min={constrainDates ? fullStartDate : ''} min={constrainDates ? constraintStartDate : ''}
max={constrainDates ? fullEndDate : ''} max={constrainDates ? constraintEndDate : ''}
class="input input-bordered w-full" class="input input-bordered w-full"
/> />
{:else} {:else}
@ -175,30 +202,17 @@
name="date" name="date"
bind:value={localStartDate} bind:value={localStartDate}
on:change={handleLocalDateChange} on:change={handleLocalDateChange}
min={constrainDates ? fullStartDate : ''} min={constrainDates ? constraintStartDate : ''}
max={constrainDates ? fullEndDate : ''} max={constrainDates ? constraintEndDate : ''}
class="input input-bordered w-full" class="input input-bordered w-full"
/> />
{/if} {/if}
{#if collection && collection.start_date && collection.end_date}
<label class="flex items-center gap-2 mt-2">
<input
type="checkbox"
class="toggle toggle-primary"
id="constrain_dates"
name="constrain_dates"
on:change={() => (constrainDates = !constrainDates)}
/>
<span class="label-text">{$t('adventures.date_constrain')}</span>
</label>
{/if}
</div> </div>
<!-- End Date --> <!-- End Date -->
{#if localStartDate} {#if localStartDate}
<div class="flex flex-col space-y-2"> <div class="space-y-2">
<label for="end_date" class="font-medium"> <label for="end_date" class="text-sm font-medium">
{$t('adventures.end_date')} {$t('adventures.end_date')}
</label> </label>
@ -210,7 +224,7 @@
bind:value={localEndDate} bind:value={localEndDate}
on:change={handleLocalDateChange} on:change={handleLocalDateChange}
min={constrainDates ? localStartDate : ''} min={constrainDates ? localStartDate : ''}
max={constrainDates ? fullEndDate : ''} max={constrainDates ? constraintEndDate : ''}
class="input input-bordered w-full" class="input input-bordered w-full"
/> />
{:else} {:else}
@ -221,21 +235,26 @@
bind:value={localEndDate} bind:value={localEndDate}
on:change={handleLocalDateChange} on:change={handleLocalDateChange}
min={constrainDates ? localStartDate : ''} min={constrainDates ? localStartDate : ''}
max={constrainDates ? fullEndDate : ''} max={constrainDates ? constraintEndDate : ''}
class="input input-bordered w-full" class="input input-bordered w-full"
/> />
{/if} {/if}
</div> </div>
{/if} {/if}
<!-- Notes --> <!-- Notes (for adventures only) -->
{#if type === 'adventure'} {#if type === 'adventure'}
<div class="flex gap-2 mb-1"> <div class="md:col-span-2">
<!-- textarea for notes --> <label for="note" class="text-sm font-medium block mb-1">
{$t('adventures.add_notes')}
</label>
<textarea <textarea
id="note"
name="note"
class="textarea textarea-bordered w-full" class="textarea textarea-bordered w-full"
placeholder={$t('adventures.add_notes')} placeholder={$t('adventures.add_notes')}
bind:value={note} bind:value={note}
rows="4"
></textarea> ></textarea>
</div> </div>
{/if} {/if}
@ -269,7 +288,7 @@
> >
<p class="text-sm text-base-content font-medium"> <p class="text-sm text-base-content font-medium">
{#if isAllDay(visit.start_date)} {#if isAllDay(visit.start_date)}
<span class="badge badge-outline mr-2">All Day</span> <span class="badge badge-outline mr-2">{$t('adventures.all_day')}</span>
{visit.start_date.split('T')[0]} {visit.end_date.split('T')[0]} {visit.start_date.split('T')[0]} {visit.end_date.split('T')[0]}
{:else} {:else}
{new Date(visit.start_date).toLocaleString()} {new Date( {new Date(visit.start_date).toLocaleString()} {new Date(

View file

@ -50,7 +50,7 @@
<div class="form-control w-full max-w-xs relative" id="tz-selector"> <div class="form-control w-full max-w-xs relative" id="tz-selector">
<label class="label" for="timezone-display"> <label class="label" for="timezone-display">
<span class="label-text">Timezone</span> <span class="label-text">{$t('adventures.timezone')}</span>
</label> </label>
<!-- Trigger --> <!-- Trigger -->

View file

@ -252,7 +252,11 @@
"collection_no_start_end_date": "Durch das Hinzufügen eines Start- und Enddatums zur Sammlung werden Reiseroutenplanungsfunktionen auf der Sammlungsseite freigegeben.", "collection_no_start_end_date": "Durch das Hinzufügen eines Start- und Enddatums zur Sammlung werden Reiseroutenplanungsfunktionen auf der Sammlungsseite freigegeben.",
"date_itinerary": "Datumstrecke", "date_itinerary": "Datumstrecke",
"no_ordered_items": "Fügen Sie der Sammlung Elemente mit Daten hinzu, um sie hier zu sehen.", "no_ordered_items": "Fügen Sie der Sammlung Elemente mit Daten hinzu, um sie hier zu sehen.",
"ordered_itinerary": "Reiseroute bestellt" "ordered_itinerary": "Reiseroute bestellt",
"additional_info": "Weitere Informationen",
"invalid_date_range": "Ungültiger Datumsbereich",
"sunrise_sunset": "Sonnenaufgang",
"timezone": "Zeitzone"
}, },
"home": { "home": {
"desc_1": "Entdecken, planen und erkunden Sie mühelos", "desc_1": "Entdecken, planen und erkunden Sie mühelos",

View file

@ -63,6 +63,7 @@
"collection_remove_error": "Error removing adventure from collection", "collection_remove_error": "Error removing adventure from collection",
"collection_link_success": "Adventure linked to collection successfully!", "collection_link_success": "Adventure linked to collection successfully!",
"invalid_date_range": "Invalid date range", "invalid_date_range": "Invalid date range",
"timezone": "Timezone",
"no_image_found": "No image found", "no_image_found": "No image found",
"collection_link_error": "Error linking adventure to collection", "collection_link_error": "Error linking adventure to collection",
"adventure_delete_confirm": "Are you sure you want to delete this adventure? This action cannot be undone.", "adventure_delete_confirm": "Are you sure you want to delete this adventure? This action cannot be undone.",

View file

@ -300,7 +300,11 @@
"collection_no_start_end_date": "Agregar una fecha de inicio y finalización a la colección desbloqueará las funciones de planificación del itinerario en la página de colección.", "collection_no_start_end_date": "Agregar una fecha de inicio y finalización a la colección desbloqueará las funciones de planificación del itinerario en la página de colección.",
"date_itinerary": "Itinerario de fecha", "date_itinerary": "Itinerario de fecha",
"no_ordered_items": "Agregue elementos con fechas a la colección para verlos aquí.", "no_ordered_items": "Agregue elementos con fechas a la colección para verlos aquí.",
"ordered_itinerary": "Itinerario ordenado" "ordered_itinerary": "Itinerario ordenado",
"additional_info": "información adicional",
"invalid_date_range": "Rango de fechas no válido",
"sunrise_sunset": "Amanecer",
"timezone": "Zona horaria"
}, },
"worldtravel": { "worldtravel": {
"all": "Todo", "all": "Todo",

View file

@ -252,7 +252,11 @@
"collection_no_start_end_date": "L'ajout d'une date de début et de fin à la collection débloquera les fonctionnalités de planification de l'itinéraire dans la page de collection.", "collection_no_start_end_date": "L'ajout d'une date de début et de fin à la collection débloquera les fonctionnalités de planification de l'itinéraire dans la page de collection.",
"date_itinerary": "Itinéraire trié par date", "date_itinerary": "Itinéraire trié par date",
"no_ordered_items": "Ajoutez des éléments avec des dates de visite à la collection pour les voir ici.", "no_ordered_items": "Ajoutez des éléments avec des dates de visite à la collection pour les voir ici.",
"ordered_itinerary": "Itinéraire trié par activité" "ordered_itinerary": "Itinéraire trié par activité",
"additional_info": "Informations Complémentaires",
"invalid_date_range": "Plage de dates non valide",
"sunrise_sunset": "Lever du soleil",
"timezone": "Fuseau horaire"
}, },
"home": { "home": {
"desc_1": "Découvrez, planifiez et explorez en toute simplicité", "desc_1": "Découvrez, planifiez et explorez en toute simplicité",

View file

@ -252,7 +252,11 @@
"collection_no_start_end_date": "L'aggiunta di una data di inizio e fine alla collezione sbloccherà le funzionalità di pianificazione dell'itinerario nella pagina della collezione.", "collection_no_start_end_date": "L'aggiunta di una data di inizio e fine alla collezione sbloccherà le funzionalità di pianificazione dell'itinerario nella pagina della collezione.",
"date_itinerary": "Data dell'itinerario", "date_itinerary": "Data dell'itinerario",
"no_ordered_items": "Aggiungi elementi con date alla collezione per vederli qui.", "no_ordered_items": "Aggiungi elementi con date alla collezione per vederli qui.",
"ordered_itinerary": "Itinerario ordinato" "ordered_itinerary": "Itinerario ordinato",
"additional_info": "Ulteriori informazioni",
"invalid_date_range": "Intervallo di date non valido",
"sunrise_sunset": "Alba",
"timezone": "Fuso orario"
}, },
"home": { "home": {
"desc_1": "Scopri, pianifica ed esplora con facilità", "desc_1": "Scopri, pianifica ed esplora con facilità",
@ -632,4 +636,4 @@
"motel": "Motel", "motel": "Motel",
"current_timezone": "Fuso orario attuale" "current_timezone": "Fuso orario attuale"
} }
} }

View file

@ -252,7 +252,11 @@
"collection_no_start_end_date": "컬렉션에 시작 및 종료 날짜를 추가하면 컬렉션 페이지에서 여정 계획 기능이 잠금 해제됩니다.", "collection_no_start_end_date": "컬렉션에 시작 및 종료 날짜를 추가하면 컬렉션 페이지에서 여정 계획 기능이 잠금 해제됩니다.",
"date_itinerary": "날짜 일정", "date_itinerary": "날짜 일정",
"no_ordered_items": "컬렉션에 날짜가있는 항목을 추가하여 여기에서 확인하십시오.", "no_ordered_items": "컬렉션에 날짜가있는 항목을 추가하여 여기에서 확인하십시오.",
"ordered_itinerary": "주문한 여정" "ordered_itinerary": "주문한 여정",
"additional_info": "추가 정보",
"invalid_date_range": "잘못된 날짜 범위",
"sunrise_sunset": "해돋이",
"timezone": "시간대"
}, },
"auth": { "auth": {
"both_passwords_required": "두 암호 모두 필요합니다", "both_passwords_required": "두 암호 모두 필요합니다",

View file

@ -252,7 +252,11 @@
"collection_no_start_end_date": "Als u een start- en einddatum aan de collectie toevoegt, ontgrendelt u de functies van de planning van de route ontgrendelen in de verzamelpagina.", "collection_no_start_end_date": "Als u een start- en einddatum aan de collectie toevoegt, ontgrendelt u de functies van de planning van de route ontgrendelen in de verzamelpagina.",
"date_itinerary": "Datumroute", "date_itinerary": "Datumroute",
"no_ordered_items": "Voeg items toe met datums aan de collectie om ze hier te zien.", "no_ordered_items": "Voeg items toe met datums aan de collectie om ze hier te zien.",
"ordered_itinerary": "Besteld reisschema" "ordered_itinerary": "Besteld reisschema",
"additional_info": "Aanvullende informatie",
"invalid_date_range": "Ongeldige datumbereik",
"sunrise_sunset": "Zonsopgang",
"timezone": "Tijdzone"
}, },
"home": { "home": {
"desc_1": "Ontdek, plan en verken met gemak", "desc_1": "Ontdek, plan en verken met gemak",

File diff suppressed because it is too large Load diff

View file

@ -300,7 +300,11 @@
"collection_no_start_end_date": "Dodanie daty rozpoczęcia i końca do kolekcji odblokuje funkcje planowania planu podróży na stronie kolekcji.", "collection_no_start_end_date": "Dodanie daty rozpoczęcia i końca do kolekcji odblokuje funkcje planowania planu podróży na stronie kolekcji.",
"date_itinerary": "Trasa daty", "date_itinerary": "Trasa daty",
"no_ordered_items": "Dodaj przedmioty z datami do kolekcji, aby je zobaczyć tutaj.", "no_ordered_items": "Dodaj przedmioty z datami do kolekcji, aby je zobaczyć tutaj.",
"ordered_itinerary": "Zamówiono trasę" "ordered_itinerary": "Zamówiono trasę",
"additional_info": "Dodatkowe informacje",
"invalid_date_range": "Niepoprawny zakres dat",
"sunrise_sunset": "Wschód słońca",
"timezone": "Strefa czasowa"
}, },
"worldtravel": { "worldtravel": {
"country_list": "Lista krajów", "country_list": "Lista krajów",

View file

@ -252,7 +252,11 @@
"collection_no_start_end_date": "Att lägga till ett start- och slutdatum till samlingen kommer att låsa upp planeringsfunktioner för resplan på insamlingssidan.", "collection_no_start_end_date": "Att lägga till ett start- och slutdatum till samlingen kommer att låsa upp planeringsfunktioner för resplan på insamlingssidan.",
"date_itinerary": "Datum resplan", "date_itinerary": "Datum resplan",
"no_ordered_items": "Lägg till objekt med datum i samlingen för att se dem här.", "no_ordered_items": "Lägg till objekt med datum i samlingen för att se dem här.",
"ordered_itinerary": "Beställd resplan" "ordered_itinerary": "Beställd resplan",
"additional_info": "Ytterligare information",
"invalid_date_range": "Ogiltigt datumintervall",
"sunrise_sunset": "Soluppgång",
"timezone": "Tidszon"
}, },
"home": { "home": {
"desc_1": "Upptäck, planera och utforska med lätthet", "desc_1": "Upptäck, planera och utforska med lätthet",

View file

@ -300,7 +300,11 @@
"collection_no_start_end_date": "在集合页面中添加开始日期和结束日期将在“收集”页面中解锁行程计划功能。", "collection_no_start_end_date": "在集合页面中添加开始日期和结束日期将在“收集”页面中解锁行程计划功能。",
"date_itinerary": "日期行程", "date_itinerary": "日期行程",
"no_ordered_items": "将带有日期的项目添加到集合中,以便在此处查看它们。", "no_ordered_items": "将带有日期的项目添加到集合中,以便在此处查看它们。",
"ordered_itinerary": "订购了行程" "ordered_itinerary": "订购了行程",
"additional_info": "附加信息",
"invalid_date_range": "无效的日期范围",
"sunrise_sunset": "日出",
"timezone": "时区"
}, },
"auth": { "auth": {
"forgot_password": "忘记密码?", "forgot_password": "忘记密码?",