From bd26e727c13578bed4ad18e78e4bcacd68fc3381 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 23 Mar 2024 18:02:57 -0400 Subject: [PATCH] Playlet is now available in English and French --- .../SearchFilters/SearchFilters.bs | 64 ++++----- .../SearchFilters/SearchFilters.xml | 12 +- playlet-lib/src/locale/en_US/translations.ts | 132 ++++++++++++++++++ playlet-lib/src/locale/fr_CA/translations.ts | 132 ++++++++++++++++++ playlet-lib/src/source/utils/Locale.bs | 42 ++++++ playlet-lib/src/source/utils/LocaleUtils.bs | 4 - .../lib/Screens/Search/SearchFilters.svelte | 24 ++-- 7 files changed, 353 insertions(+), 57 deletions(-) diff --git a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs index a0a7c692..8a194ec1 100644 --- a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs +++ b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs @@ -1,105 +1,103 @@ import "pkg:/components/Navigation/Navigation.bs" import "pkg:/source/utils/ArrayUtils.bs" +import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Types.bs" function Init() options = { date: [{ - title: "Any date" + title: Tr(Locale.SearchFilters.AnyDate) value: "" }, { - title: "Last hour" + title: Tr(Locale.SearchFilters.LastHour) value: "hour" }, { - title: "Today" + title: Tr(Locale.SearchFilters.Today) value: "today" }, { - title: "This week" + title: Tr(Locale.SearchFilters.ThisWeek) value: "week" }, { - title: "This month" + title: Tr(Locale.SearchFilters.ThisMonth) value: "month" }, { - title: "This year" + title: Tr(Locale.SearchFilters.ThisYear) value: "year" }] type: [{ - title: "Any type" + title: Tr(Locale.SearchFilters.AnyType) value: "" }, { - title: "Video" + title: Tr(Locale.SearchFilters.Video) value: "video" }, { - title: "Playlist" + title: Tr(Locale.SearchFilters.Playlist) value: "playlist" }, { - title: "Channel" + title: Tr(Locale.SearchFilters.Channel) value: "channel" }, { - title: "Movie" + title: Tr(Locale.SearchFilters.Movie) value: "movie" - }, { - title: "Show" - value: "show" }] duration: [{ - title: "Any duration" + title: Tr(Locale.SearchFilters.AnyDuration) value: "" }, { - title: "Under 4 minutes" + title: Tr(Locale.SearchFilters.Under4Minutes) value: "short" }, { - title: "4 - 20 minutes" + title: Tr(Locale.SearchFilters.FourTo20Minutes) value: "medium" }, { - title: "Over 20 minutes" + title: Tr(Locale.SearchFilters.Over20Minutes) value: "long" }] features: [{ - title: "Live" + title: Tr(Locale.Feed.Live) value: "live" }, { - title: "4K" + title: Tr(Locale.SearchFilters.FourK) value: "4k" }, { - title: "HD" + title: Tr(Locale.SearchFilters.HD) value: "hd" }, { - title: "Subtitles/CC" + title: Tr(Locale.SearchFilters.SubtitlesCC) value: "subtitles" }, { - title: "Creative Commons" + title: Tr(Locale.SearchFilters.CreativeCommons) value: "creative_commons" }, { - title: "360°" + title: Tr(Locale.SearchFilters.ThreeSixty) value: "360" }, { - title: "VR180" + title: Tr(Locale.SearchFilters.VR180) value: "vr180" }, { - title: "3D" + title: Tr(Locale.SearchFilters.ThreeD) value: "3d" }, { - title: "HDR" + title: Tr(Locale.SearchFilters.HDR) value: "hdr" }, { - title: "Purchased" + title: Tr(Locale.SearchFilters.Purchased) value: "purchased" }, { - title: "Location" + title: Tr(Locale.SearchFilters.Location) value: "location" }] sort_by: [{ - title: "Relevance" + title: Tr(Locale.SearchFilters.Relevance) value: "" }, { - title: "Upload date" + title: Tr(Locale.SearchFilters.UploadDate) value: "upload_date" }, { - title: "View count" + title: Tr(Locale.SearchFilters.ViewCount) value: "view_count" }, { - title: "Rating" + title: Tr(Locale.SearchFilters.Rating) value: "rating" }] } diff --git a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml index 3dcd4c2e..6a75ef72 100644 --- a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml +++ b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.xml @@ -14,14 +14,14 @@ + translation="[20,20]"> @@ -74,7 +74,7 @@ vertFocusAnimationStyle="floatingFocus" font="dictionary:ItemFont" focusedFont="dictionary:ItemFocusedFont" - itemSize="[190,42]"> + itemSize="[230,42]"> @@ -112,7 +112,7 @@ vertFocusAnimationStyle="floatingFocus" font="dictionary:ItemFont" focusedFont="dictionary:ItemFocusedFont" - itemSize="[150,42]"> + itemSize="[190,42]"> diff --git a/playlet-lib/src/locale/en_US/translations.ts b/playlet-lib/src/locale/en_US/translations.ts index de9cf0ab..a43d28ba 100644 --- a/playlet-lib/src/locale/en_US/translations.ts +++ b/playlet-lib/src/locale/en_US/translations.ts @@ -1108,5 +1108,137 @@ Add to %1 bookmark Add to %1 bookmark + + Upload date + Upload date + + + Type + Type + + + Duration + Duration + + + Features + Features + + + Sort by + Sort by + + + Any date + Any date + + + Last hour + Last hour + + + Today + Today + + + This week + This week + + + This month + This month + + + This year + This year + + + Any type + Any type + + + Video + Video + + + Playlist + Playlist + + + Channel + Channel + + + Movie + Movie + + + Any duration + Any duration + + + Under 4 minutes + Under 4 minutes + + + 4 - 20 minutes + 4 - 20 minutes + + + Over 20 minutes + Over 20 minutes + + + 4K + 4K + + + HD + HD + + + Subtitles/CC + Subtitles/CC + + + Creative Commons + Creative Commons + + + 360° + 360° + + + VR180 + VR180 + + + 3D + 3D + + + HDR + HDR + + + Purchased + Purchased + + + Location + Location + + + Relevance + Relevance + + + View count + View count + + + Rating + Rating + \ No newline at end of file diff --git a/playlet-lib/src/locale/fr_CA/translations.ts b/playlet-lib/src/locale/fr_CA/translations.ts index cc27912e..2d7fe8b8 100644 --- a/playlet-lib/src/locale/fr_CA/translations.ts +++ b/playlet-lib/src/locale/fr_CA/translations.ts @@ -1106,5 +1106,137 @@ Add to %1 bookmark Ajouter au favori %1 + + Upload date + Date d'ajout + + + Type + Type + + + Duration + Durée + + + Features + Caractéristiques + + + Sort by + Trier par + + + Any date + Tout + + + Last hour + Dernière heure + + + Today + Aujourd'hui + + + This week + Cette semaine + + + This month + Ce mois-ci + + + This year + Cette année + + + Any type + Tout + + + Video + Vidéo + + + Playlist + Playlist + + + Channel + Chaîne + + + Movie + Film + + + Any duration + Tout + + + Under 4 minutes + Moins de 4 minutes + + + 4 - 20 minutes + Entre 4 et 20 minutes + + + Over 20 minutes + Plus de 20 minutes + + + 4K + 4K + + + HD + HD + + + Subtitles/CC + Sous-titres + + + Creative Commons + Creative Commons + + + 360° + 360° + + + VR180 + VR180 + + + 3D + 3D + + + HDR + HDR + + + Purchased + Acheté + + + Location + Lieu + + + Relevance + Pertinence + + + View count + Nombre de vues + + + Rating + Avis + \ No newline at end of file diff --git a/playlet-lib/src/source/utils/Locale.bs b/playlet-lib/src/source/utils/Locale.bs index 31d34081..f010d06a 100644 --- a/playlet-lib/src/source/utils/Locale.bs +++ b/playlet-lib/src/source/utils/Locale.bs @@ -377,4 +377,46 @@ namespace Locale AddToBookmark = "Add to %1 bookmark" end enum + @locale + enum SearchFilters + UploadDate = "Upload date" + Type = "Type" + Duration = "Duration" + Features = "Features" + SortBy = "Sort by" + + AnyDate = "Any date" + LastHour = "Last hour" + Today = "Today" + ThisWeek = "This week" + ThisMonth = "This month" + ThisYear = "This year" + + AnyType = "Any type" + Video = "Video" + Playlist = "Playlist" + Channel = "Channel" + Movie = "Movie" + + AnyDuration = "Any duration" + Under4Minutes = "Under 4 minutes" + FourTo20Minutes = "4 - 20 minutes" + Over20Minutes = "Over 20 minutes" + + ' Live = "Live" + FourK = "4K" + HD = "HD" + SubtitlesCC = "Subtitles/CC" + CreativeCommons = "Creative Commons" + ThreeSixty = "360°" + VR180 = "VR180" + ThreeD = "3D" + HDR = "HDR" + Purchased = "Purchased" + Location = "Location" + + Relevance = "Relevance" + ViewCount = "View count" + Rating = "Rating" + end enum end namespace diff --git a/playlet-lib/src/source/utils/LocaleUtils.bs b/playlet-lib/src/source/utils/LocaleUtils.bs index 001f2ee2..2859e4dc 100644 --- a/playlet-lib/src/source/utils/LocaleUtils.bs +++ b/playlet-lib/src/source/utils/LocaleUtils.bs @@ -1,7 +1,3 @@ -' TODO:P2 Translations left: -' - Search filters (App+Web) -' - Loading messages - import "pkg:/source/utils/MathUtils.bs" namespace LocaleUtils diff --git a/playlet-web/src/lib/Screens/Search/SearchFilters.svelte b/playlet-web/src/lib/Screens/Search/SearchFilters.svelte index 294acd29..c5896d07 100644 --- a/playlet-web/src/lib/Screens/Search/SearchFilters.svelte +++ b/playlet-web/src/lib/Screens/Search/SearchFilters.svelte @@ -81,10 +81,6 @@ title: "Movie", value: "movie", }, - { - title: "Show", - value: "show", - }, ], duration: [ { @@ -181,37 +177,37 @@

{label}

-

Date

+

{$tr("Upload date")}

-

Type

+

{$tr("Type")}

-

Duration

+

{$tr("Duration")}

-

Features

+

{$tr("Features")}

{#each options.features as { title, value }} {/each}
-

Sort By

+

{$tr("Sort by")}