From 7446efb6566823d47b4485ae026cbc37b79f5d81 Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Fri, 15 Nov 2024 19:13:11 +0200 Subject: [PATCH 1/8] feat: add trip planner localization for multiple languages --- src/locales/am.json | 14 +++++++++++++- src/locales/ar.json | 13 +++++++++++++ src/locales/en.json | 13 +++++++++++++ src/locales/es.json | 14 +++++++++++++- src/locales/pl.json | 14 +++++++++++++- src/locales/so.json | 14 +++++++++++++- src/locales/tl.json | 13 +++++++++++++ src/locales/vi.json | 13 +++++++++++++ 8 files changed, 104 insertions(+), 4 deletions(-) diff --git a/src/locales/am.json b/src/locales/am.json index ec23483..517c635 100644 --- a/src/locales/am.json +++ b/src/locales/am.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "ጉዞዎን ያቅዱ", + "itinerary": "ጉዞ አይነት", + "duration": "ቆይታ ጊዜ", + "start_time": "መነሻ ጊዜ", + "end_time": "መጨረሻ ጊዜ", + "minutes": "ደቂቃዎች", + "distance": "ርቀት", + "end": "መጨረሻ", + "meters": "ሜትሮች", + "no_itineraries_found": "ምንም ጉዞ አይነት አልተገኘም", + "loading": "በመጫን ላይ..." + }, "search": { "placeholder": "ቆሻሻዎችን፣ መንገዶችን እና ቦታዎችን ይፈልጉ", "results_for": "የፍለጋ ውጤቶች ለ", @@ -45,7 +58,6 @@ "min": "ደቂቃ", "mins": "ደቂቃዎች" }, - "vehicle": { "number": "ተሽከርካሪ #", "data_updated": "የተሻሻለ ውሂብ", diff --git a/src/locales/ar.json b/src/locales/ar.json index 63618d4..59c7ea9 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "خطط رحلتك", + "itinerary": "مسار الرحلة", + "duration": "المدة", + "start_time": "وقت البدء", + "end_time": "وقت الانتهاء", + "minutes": "دقيقة", + "distance": "المسافة", + "end": "النهاية", + "meters": "الأمتار", + "no_itineraries_found": "لم يتم العثور على مسارات", + "loading": "جاري التحميل..." + }, "search": { "placeholder": "ابحث عن المحطات، المسارات، والأماكن", "results_for": "نتائج البحث عن", diff --git a/src/locales/en.json b/src/locales/en.json index adcd59b..74ffd86 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "Plan Your Trip", + "itinerary": "Itinerary", + "duration": "Duration", + "start_time": "Start Time", + "end_time": "End Time", + "minutes": "min", + "distance": "Distance", + "end": "End", + "meters": "meters", + "no_itineraries_found": "No itineraries found", + "loading": "Loading..." + }, "search": { "placeholder": "Search for stops, routes, and places", "results_for": "Search results for", diff --git a/src/locales/es.json b/src/locales/es.json index e0c0969..5eaad9a 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "Planifica tu viaje", + "itinerary": "Itinerario", + "duration": "Duración", + "start_time": "Hora de inicio", + "end_time": "Hora de finalización", + "minutes": "minutos", + "distance": "Distancia", + "end": "Final", + "meters": "metros", + "no_itineraries_found": "No se encontraron itinerarios", + "loading": "Cargando..." + }, "search": { "placeholder": "Buscar paradas, rutas y lugares", "results_for": "Resultados de búsqueda para", @@ -34,7 +47,6 @@ "stop": "Parada", "routes": "Rutas", "route": "Ruta", - "route_modal_title": "Ruta {name}", "loading": "Cargando", "arrives": "llega", "NA": "N/D", diff --git a/src/locales/pl.json b/src/locales/pl.json index be70d98..08840b5 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "Zaplanuj swoją podróż", + "itinerary": "Plan podróży", + "duration": "Czas trwania", + "start_time": "Czas rozpoczęcia", + "end_time": "Czas zakończenia", + "minutes": "minuty", + "distance": "Odległość", + "end": "Koniec", + "meters": "metry", + "no_itineraries_found": "Nie znaleziono planów podróży", + "loading": "Ładowanie..." + }, "search": { "placeholder": "Szukaj przystanków, tras i miejsc", "results_for": "Wyniki wyszukiwania dla", @@ -34,7 +47,6 @@ "stop": "Przystanek", "routes": "Trasy", "route": "trasa", - "route_modal_title": "Trasa {name}", "loading": "Ładowanie", "arrives": "przyjeżdża", "NA": "N/D", diff --git a/src/locales/so.json b/src/locales/so.json index 4df98ec..6020bd4 100644 --- a/src/locales/so.json +++ b/src/locales/so.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "Qorshee safarkaaga", + "itinerary": "Jadwalka safarka", + "duration": "Mudada", + "start_time": "Waqtiga bilowga", + "end_time": "Waqtiga dhamaadka", + "minutes": "daqiiqado", + "distance": "Masaafada", + "end": "Dhamaadka", + "meters": "mitir", + "no_itineraries_found": "Jadwal safar lama helin", + "loading": "Shaqeynaya..." + }, "search": { "placeholder": "Raadi joogsiyo, wadooyin iyo meelo", "results_for": "Natiijooyinka raadinta ee", @@ -34,7 +47,6 @@ "stop": "Joogsi", "routes": "Jidadka", "route": "Jidka", - "route_modal_title": "Jidka {name}", "loading": "Shaqeynaya", "arrives": "imaataa", "NA": "M/Q", diff --git a/src/locales/tl.json b/src/locales/tl.json index 27ab8ae..bf06d72 100644 --- a/src/locales/tl.json +++ b/src/locales/tl.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "Planuhin ang iyong biyahe", + "itinerary": "Itineraryo", + "duration": "Tagal", + "start_time": "Oras ng pagsisimula", + "end_time": "Oras ng pagtatapos", + "minutes": "minuto", + "distance": "Distansya", + "end": "Wakas", + "meters": "metro", + "no_itineraries_found": "Walang nahanap na itineraryo", + "loading": "Naglo-load..." + }, "search": { "placeholder": "Maghanap ng mga hintuan, ruta, at lugar", "results_for": "Mga resulta ng paghahanap para sa", diff --git a/src/locales/vi.json b/src/locales/vi.json index 97fc839..f5c44ed 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -1,4 +1,17 @@ { + "trip-planner": { + "plan_your_trip": "Lập kế hoạch hành trình", + "itinerary": "Lịch trình", + "duration": "Thời gian", + "start_time": "Thời gian bắt đầu", + "end_time": "Thời gian kết thúc", + "minutes": "phút", + "distance": "Khoảng cách", + "end": "Kết thúc", + "meters": "mét", + "no_itineraries_found": "Không tìm thấy lịch trình", + "loading": "Đang tải..." + }, "search": { "placeholder": "Tìm kiếm trạm dừng, tuyến đường và địa điểm", "results_for": "Kết quả tìm kiếm cho", From 54df253990de5770af2167f0a25537571e986d1b Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Fri, 15 Nov 2024 19:13:29 +0200 Subject: [PATCH 2/8] feat: update trip planner button text for localization support --- src/components/trip-planner/TripPlan.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/trip-planner/TripPlan.svelte b/src/components/trip-planner/TripPlan.svelte index 455f09e..7a7af65 100644 --- a/src/components/trip-planner/TripPlan.svelte +++ b/src/components/trip-planner/TripPlan.svelte @@ -4,6 +4,7 @@ import TripPlanSearchField from './TripPlanSearchField.svelte'; import { error } from '@sveltejs/kit'; import { browser } from '$app/environment'; + import { t } from 'svelte-i18n'; export let mapProvider; let fromPlace = ''; @@ -212,7 +213,7 @@ Planning... {:else} - Plan Your Trip + {$t('trip-planner.plan_your_trip')} {/if} From e2091a49985a92229f72107a61979235b4b73b05 Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Fri, 15 Nov 2024 19:14:13 +0200 Subject: [PATCH 3/8] feat: localization trip planner --- src/components/trip-planner/ItineraryDetails.svelte | 12 ++++++++---- src/components/trip-planner/ItineraryTab.svelte | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/trip-planner/ItineraryDetails.svelte b/src/components/trip-planner/ItineraryDetails.svelte index 8c15685..f0ccd80 100644 --- a/src/components/trip-planner/ItineraryDetails.svelte +++ b/src/components/trip-planner/ItineraryDetails.svelte @@ -1,6 +1,7 @@ - + {#if loading} {/if} @@ -82,7 +83,7 @@ {:else}
- No itineraries found + {$t('trip-planner.no_itineraries_found')}
{/if}