Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added locale strings for DuckPlayer #1027

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"copy-sjcl": "node scripts/generateSJCL.js",
"bundle-config": "node scripts/bundleConfig.mjs",
"build": "npm run build-locales && npm run build-types && npm run bundle-trackers && npm run build-firefox && npm run build-chrome && npm run build-apple && npm run build-android && npm run build-windows && npm run build-integration && npm run build-chrome-mv3",
"build-locales": "node scripts/buildLocales.js --dir src/locales/click-to-load --output build/locales/ctl-locales.js",
"build-locales": "node scripts/buildLocales.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this configuration into the script - so instead of the flags, we just list out all the projects requiring the bundled translations

"build-firefox": "node scripts/inject.js --platform firefox",
"build-chrome": "node scripts/inject.js --platform chrome",
"build-chrome-mv3": "node scripts/inject.js --platform chrome-mv3",
Expand Down
31 changes: 16 additions & 15 deletions packages/special-pages/pages/duckplayer/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@ export async function init (messaging, baseEnvironment) {

document.body.dataset.display = environment.display

const strings = environment.locale === 'en'
? enStrings
: await fetch(`./locales/${environment.locale}/duckplayer.json`)
.then(resp => {
if (!resp.ok) {
throw new Error('did not give a result')
}
return resp.json()
})
.catch(e => {
console.error('Could not load locale', environment.locale, e)
return enStrings
})
// This will be re-enabled in the mobile PR
// const strings = environment.locale === 'en'
// ? enStrings
// : await fetch(`./locales/${environment.locale}/duckplayer.json`)
// .then(resp => {
// if (!resp.ok) {
// throw new Error('did not give a result')
// }
// return resp.json()
// })
// .catch(e => {
// console.error('Could not load locale', environment.locale, e)
// return enStrings
// })
Comment on lines +44 to +57
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets re-enabled later when we support mobile - but by removing it here, we can merge these strings in without risking untested UI hitting prod


const settings = new Settings({})
.withPlatformName(baseEnvironment.injectName)
Expand Down Expand Up @@ -86,7 +87,7 @@ export async function init (messaging, baseEnvironment) {
willThrow={environment.willThrow}>
<ErrorBoundary didCatch={didCatch} fallback={<Fallback showDetails={environment.env === 'development'}/>}>
<UpdateEnvironment search={window.location.search}/>
<TranslationProvider translationObject={strings} fallback={enStrings} textLength={environment.textLength}>
<TranslationProvider translationObject={enStrings} fallback={enStrings} textLength={environment.textLength}>
<MessagingContext.Provider value={messaging}>
<SettingsProvider settings={settings}>
<UserValuesProvider initial={init.userValues}>
Expand All @@ -105,7 +106,7 @@ export async function init (messaging, baseEnvironment) {
render(
<EnvironmentProvider debugState={false} injectName={environment.injectName}>
<MessagingContext.Provider value={messaging}>
<TranslationProvider translationObject={strings} fallback={enStrings} textLength={environment.textLength}>
<TranslationProvider translationObject={enStrings} fallback={enStrings} textLength={environment.textLength}>
<Components />
</TranslationProvider>
</MessagingContext.Provider>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "Видеоклиповете в YouTube винаги да се отварят тук",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Duck Player да остане включен",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Отваряне на информацията",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Отваряне на настройки",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Гледане в YouTube",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>ГРЕШКА:</b> невалиден идентификатор на видеоклипа",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Duck Player осигурява чисто изживяване без персонализирани реклами в YouTube и предотвратява влиянието на вече гледаните видеоклипове върху препоръките на YouTube."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "Vždy otevírat videa YouTube tady",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Nechat zapnutý přehrávač Duck Player",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Otevřít informace",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Otevřené nastavení",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Sledovat na YouTube",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>CHYBA:</b> Neplatné ID videa",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Přehrávač Duck Player nabízí sledování v minimalistickém prostředí bez personalizovaných reklam a brání tomu, aby sledovaná videa ovlivňovala tvoje doporučení na YouTube."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "Åbn altid YouTube-videoer her",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Hold Duck Player slået til",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Åbn info",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Åbn Indstillinger",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Se på YouTube",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>FEJL:</b> Ugyldigt video-ID",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Duck Player giver en ren seeroplevelse uden målrettede annoncer og forhindrer, at visningsaktivitet påvirker dine YouTube-anbefalinger."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "YouTube-Videos immer hier öffnen",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Duck Player aktiviert lassen",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Info öffnen",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Einstellungen öffnen",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Auf YouTube ansehen",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>FEHLER:</b> Ungültige Video-ID",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Mit Duck Player kannst du dir ungestört und ohne personalisierte Werbung Inhalte ansehen. Er verhindert, dass das, was du dir ansiehst, deine YouTube-Empfehlungen beeinflussen."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "Ανοίγετε πάντα τα βίντεο του YouTube εδώ",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Διατηρήστε το Duck Player ενεργοποιημένο",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Ανοίξτε για πληροφορίες",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Άνοιγμα ρυθμίσεων",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Παρακολούθηση στο YouTube",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>ΣΦΑΛΜΑ:</b> Μη έγκυρο αναγνωριστικό βίντεο",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Το Duck Player παρέχει μια καθαρή εμπειρία προβολής χωρίς εξατομικευμένες διαφημίσεις, ενώ εμποδίζει τη δραστηριότητα προβολής να επηρεάσει τις συστάσεις που θα λαμβάνετε στο YouTube."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"invalidIdError": {
"title": "<b>ERROR:</b> Invalid video id",
"note": "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo": {
"title": "Duck Player provides a clean viewing experience without personalized ads and prevents viewing activity from influencing your YouTube recommendations."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "Abrir siempre los vídeos de YouTube aquí",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Mantener Duck Player activado",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Abrir información",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Abrir ajustes",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Ver en YouTube",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>ERROR:</b> ID de vídeo no válida",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Duck Player ofrece una experiencia de visualización limpia sin anuncios personalizados e impide que la actividad de visualización influya en tus recomendaciones de YouTube."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "Ava YouTube'i videod alati siin",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Hoia Duck Player sisse lülitatud",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Ava teave",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Ava seaded",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Vaata YouTube'is",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>VIGA:</b> vale video ID",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Duck Player pakub isikupärastatud reklaamidest vaba vaatamiskogemust ja takistab, et vaatamisaktiivsus mõjutaks sinu YouTube'i soovitusi."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"smartling" : {
"string_format" : "icu",
"translate_paths" : [
{
"path" : "*/title",
"key" : "{*}/title",
"instruction" : "*/note"
}]
},
"alwaysWatchHere" : {
"title" : "Avaa YouTube-videot aina täällä",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"keepEnabled" : {
"title" : "Pidä Duck Player käytössä",
"note" : "label text for a checkbox that enables this feature for all videos, not just the current one"
},
"openInfoButton" : {
"title" : "Avaa tiedot",
"note" : "aria label text on a button, to indicate there's more information to be shown if clicked"
},
"openSettingsButton" : {
"title" : "Avaa asetukset",
"note" : "aria label text on a button, opens a screen where the user can change settings"
},
"watchOnYoutube" : {
"title" : "Katso YouTubessa",
"note" : "text on a link that takes the user from the current page back onto YouTube.com"
},
"invalidIdError" : {
"title" : "<b>VIRHE:</b> virheellinen videotunnus",
"note" : "Shown when the page URL doesn't match a known video ID. Note for translators: The <b> tag makes the word 'ERROR:' bold. Depending on the grammar of the target language, you might need to move it so that the correct word is emphasized."
},
"tooltipInfo" : {
"title" : "Duck Player tarjoaa puhtaan katselukokemuksen ilman kohdennettuja mainoksia ja estää katseluhistoriaa vaikuttamasta YouTube-suosituksiisi."
}
}
Loading
Loading