From 058b8f82ab43b828360e976f985dcecf6a64b25a Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Sat, 11 Sep 2021 10:17:54 +0800 Subject: [PATCH 1/3] i18n + Fix autoplay string - Rephrased the autoplay help text (https://discord.com/channels/362322208485277697/646840786662719488/885903447243780096) - Weekly i18n update. --- static/app-strings.json | 2 +- ui/component/settingContent/view.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 2e5e62543..ff7b34a46 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -157,7 +157,7 @@ "Autoplay media files": "Autoplay media files", "Autoplay video and audio files when navigating to a file.": "Autoplay video and audio files when navigating to a file.", "Autoplay next recommended content": "Autoplay next recommended content", - "Autoplay video and audio files as the next related item when a file finishes playing.": "Autoplay video and audio files as the next related item when a file finishes playing.", + "Autoplay the next related item when a file (video or audio) finishes playing.": "Autoplay the next related item when a file (video or audio) finishes playing.", "Clear application cache": "Clear application cache", "Clear Cache": "Clear Cache", "This might fix issues that you are having. Your wallet will not be affected.": "This might fix issues that you are having. Your wallet will not be affected.", diff --git a/ui/component/settingContent/view.jsx b/ui/component/settingContent/view.jsx index e520fbc70..7f0b5f47a 100644 --- a/ui/component/settingContent/view.jsx +++ b/ui/component/settingContent/view.jsx @@ -220,7 +220,7 @@ export default function SettingContent(props: Props) { const HELP = { FLOATING_PLAYER: 'Keep content playing in the corner when navigating to a different page.', AUTOPLAY_MEDIA: 'Autoplay video and audio files when navigating to a file.', - AUTOPLAY_NEXT: 'Autoplay video and audio files as the next related item when a file finishes playing.', + AUTOPLAY_NEXT: 'Autoplay the next related item when a file (video or audio) finishes playing.', HIDE_REPOSTS: 'You will not see reposts by people you follow or receive email notifying about them.', SHOW_MATURE: 'Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ', MAX_PURCHASE_PRICE: 'This will prevent you from purchasing any content over a certain cost, as a safety measure.', From f5fb5c87c47bfaf299b8f98ac9f67e0515a1beee Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Sat, 11 Sep 2021 10:34:18 +0800 Subject: [PATCH 2/3] Fix i18n word used as variables. This is the same as concatenating strings, which we must avoid. It will be hard for translators to handle as they see strings as individual entries, not programmable strings. Untranslated variable values are fine. https://www.linkedin.com/pulse/internationalization-localization-tips-concatenation-daniel-neumann --- static/app-strings.json | 4 ++++ ui/component/autoplayCountdown/view.jsx | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index ff7b34a46..a128867f2 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1177,7 +1177,11 @@ "Tap to unmute": "Tap to unmute", "Retry": "Retry", "Playing in %seconds_left% seconds...": "Playing in %seconds_left% seconds...", + "Playing next free content in %seconds_left% seconds...": "Playing next free content in %seconds_left% seconds...", "Autoplay timer paused.": "Autoplay timer paused.", + "Play Previous": "Play Previous", + "Purchase?": "Purchase?", + "Replay?": "Replay?", "0 Bytes": "0 Bytes", "Bytes": "Bytes", "KB": "KB", diff --git a/ui/component/autoplayCountdown/view.jsx b/ui/component/autoplayCountdown/view.jsx index f1fd4b78f..9aa6eb4ed 100644 --- a/ui/component/autoplayCountdown/view.jsx +++ b/ui/component/autoplayCountdown/view.jsx @@ -50,6 +50,14 @@ function AutoplayCountdown(props: Props) { return elm && elm.getBoundingClientRect().top < 0; } + function getMsgPlayingNext() { + if (skipPaid) { + return __('Playing next free content in %seconds_left% seconds...', { seconds_left: timer }); + } else { + return __('Playing in %seconds_left% seconds...', { seconds_left: timer }); + } + } + // Update 'setTimerPaused'. React.useEffect(() => { // Ensure correct 'setTimerPaused' on initial render. @@ -112,10 +120,7 @@ function AutoplayCountdown(props: Props) { )} {!isTimerPaused && (
- {__('Playing %message% in %seconds_left% seconds...', { - message: skipPaid ? __('next free content') : __(''), - seconds_left: timer, - })}{' '} + {getMsgPlayingNext()}{' '}