From 6e2136e1552ecd4e39e4a95c145df4e6c317057c Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 21 Jun 2024 18:17:02 -0300 Subject: [PATCH] feat: replace hard coded string with i18n --- src/locales/en/translation.json | 7 +++- src/locales/es/translation.json | 35 +++++++++++++++++-- src/locales/pt/translation.json | 7 +++- src/locales/ru/translation.json | 35 +++++++++++++++++-- .../settings/add-download-source-modal.tsx | 12 ++++--- 5 files changed, 85 insertions(+), 11 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 53d601429..0404c9430 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -183,7 +183,12 @@ "sync_download_sources": "Sync sources", "removed_download_source": "Download source removed", "added_download_source": "Added download source", - "download_sources_synced": "All download sources are synced" + "download_sources_synced": "All download sources are synced", + "insert_valid_json_url": "Insert a valid JSON url", + "found_download_option_zero": "No download option found", + "found_download_option_one": "Found {{countFormatted}} download option", + "found_download_option_other": "Found {{countFormatted}} download options", + "import": "Import" }, "notifications": { "download_complete": "Download complete", diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 2cada4f48..590857bbc 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -1,4 +1,7 @@ { + "app": { + "successfully_signed_in": "Successfully signed in (TRANSLATE ME)" + }, "home": { "featured": "Destacado", "trending": "Tendencias", @@ -16,7 +19,8 @@ "filter": "Buscar en la biblioteca", "home": "Inicio", "queued": "{{title}} (En Cola)", - "game_has_no_executable": "El juego no tiene un ejecutable" + "game_has_no_executable": "El juego no tiene un ejecutable", + "sign_in": "Sign in (TRANSLATE ME)" }, "header": { "search": "Buscar juegos", @@ -179,7 +183,12 @@ "sync_download_sources": "Sincronizar fuentes", "removed_download_source": "Fuente de descarga eliminada", "added_download_source": "Fuente de descarga añadida", - "download_sources_synced": "Todas las fuentes de descarga estánn actualizadas" + "download_sources_synced": "Todas las fuentes de descarga estánn actualizadas (TRANSLATE ME)", + "insert_valid_json_url": "Insert a valid JSON url (TRANSLATE ME)", + "found_download_option_zero": "No download option found (TRANSLATE ME)", + "found_download_option_one": "Found {{countFormatted}} download option (TRANSLATE ME)", + "found_download_option_other": "Found {{countFormatted}} download options (TRANSLATE ME)", + "import": "Import (TRANSLATE ME)" }, "notifications": { "download_complete": "Descarga completada", @@ -205,5 +214,27 @@ }, "forms": { "toggle_password_visibility": "Cambiar visibilidad de contraseña" + }, + "user_profile": { + "amount_hours": "{{amount}} hours (TRANSLATE ME)", + "amount_minutes": "{{amount}} minutes (TRANSLATE ME)", + "last_time_played": "Last played {{period}} (TRANSLATE ME)", + "activity": "Recent activity (TRANSLATE ME)", + "library": "Library (TRANSLATE ME)", + "total_play_time": "Total playtime: {{amount}} (TRANSLATE ME)", + "no_recent_activity_title": "Hmmm… nothing here (TRANSLATE ME)", + "no_recent_activity_description": "You haven't played any games recently. It's time to change that! (TRANSLATE ME)", + "display_name": "Display name (TRANSLATE ME)", + "saving": "Saving (TRANSLATE ME)", + "save": "Save (TRANSLATE ME)", + "edit_profile": "Edit Profile (TRANSLATE ME)", + "saved_successfully": "Saved successfully (TRANSLATE ME)", + "try_again": "Please, try again (TRANSLATE ME)", + "sign_out_modal_title": "Are you sure? (TRANSLATE ME)", + "cancel": "Cancel (TRANSLATE ME)", + "successfully_signed_out": "Successfully signed out (TRANSLATE ME)", + "sign_out": "Sign out (TRANSLATE ME)", + "playing_for": "Playing for {{amount}} (TRANSLATE ME)", + "sign_out_modal_text": "Your library is linked with your current account. When signing out, your library will not be visible anymore, and any progress will not be saved. Continue with sign out? (TRANSLATE ME)" } } diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index de457a460..f34f23894 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -179,7 +179,12 @@ "sync_download_sources": "Sincronizar", "removed_download_source": "Fonte removida", "added_download_source": "Fonte adicionada", - "download_sources_synced": "As fontes foram sincronizadas" + "download_sources_synced": "As fontes foram sincronizadas", + "insert_valid_json_url": "Insira a url de um JSON válido", + "found_download_option_zero": "Nenhuma opção de download encontrada", + "found_download_option_one": "{{countFormatted}} opção de download encontrada", + "found_download_option_other": "{{countFormatted}} opções de download encontradas", + "import": "Importar" }, "notifications": { "download_complete": "Download concluído", diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json index 71b6d7466..5019de5ea 100644 --- a/src/locales/ru/translation.json +++ b/src/locales/ru/translation.json @@ -1,4 +1,7 @@ { + "app": { + "successfully_signed_in": "Successfully signed in (TRANSLATE ME)" + }, "home": { "featured": "Рекомендованное", "trending": "В тренде", @@ -16,7 +19,8 @@ "filter": "Фильтр библиотеки", "home": "Главная", "queued": "{{title}} (В очереди)", - "game_has_no_executable": "Файл запуска игры не выбран" + "game_has_no_executable": "Файл запуска игры не выбран", + "sign_in": "Sign in (TRANSLATE ME)" }, "header": { "search": "Поиск", @@ -179,7 +183,12 @@ "sync_download_sources": "Синхронизировать источники", "removed_download_source": "Источник загрузок удален", "added_download_source": "Источник загрузок добавлен", - "download_sources_synced": "Все источники загрузок синхронизированы" + "download_sources_synced": "All download sources are synced (TRANSLATE ME)", + "insert_valid_json_url": "Insert a valid JSON url (TRANSLATE ME)", + "found_download_option_zero": "No download option found (TRANSLATE ME)", + "found_download_option_one": "Found {{countFormatted}} download option (TRANSLATE ME)", + "found_download_option_other": "Found {{countFormatted}} download options (TRANSLATE ME)", + "import": "Import (TRANSLATE ME)" }, "notifications": { "download_complete": "Загрузка завершена", @@ -205,5 +214,27 @@ }, "forms": { "toggle_password_visibility": "Показывать пароль" + }, + "user_profile": { + "amount_hours": "{{amount}} hours (TRANSLATE ME)", + "amount_minutes": "{{amount}} minutes (TRANSLATE ME)", + "last_time_played": "Last played {{period}} (TRANSLATE ME)", + "activity": "Recent activity (TRANSLATE ME)", + "library": "Library (TRANSLATE ME)", + "total_play_time": "Total playtime: {{amount}} (TRANSLATE ME)", + "no_recent_activity_title": "Hmmm… nothing here (TRANSLATE ME)", + "no_recent_activity_description": "You haven't played any games recently. It's time to change that! (TRANSLATE ME)", + "display_name": "Display name (TRANSLATE ME)", + "saving": "Saving (TRANSLATE ME)", + "save": "Save (TRANSLATE ME)", + "edit_profile": "Edit Profile (TRANSLATE ME)", + "saved_successfully": "Saved successfully (TRANSLATE ME)", + "try_again": "Please, try again (TRANSLATE ME)", + "sign_out_modal_title": "Are you sure? (TRANSLATE ME)", + "cancel": "Cancel (TRANSLATE ME)", + "successfully_signed_out": "Successfully signed out (TRANSLATE ME)", + "sign_out": "Sign out (TRANSLATE ME)", + "playing_for": "Playing for {{amount}} (TRANSLATE ME)", + "sign_out_modal_text": "Your library is linked with your current account. When signing out, your library will not be visible anymore, and any progress will not be saved. Continue with sign out? (TRANSLATE ME)" } } diff --git a/src/renderer/src/pages/settings/add-download-source-modal.tsx b/src/renderer/src/pages/settings/add-download-source-modal.tsx index 78c3dbc66..10e497dd4 100644 --- a/src/renderer/src/pages/settings/add-download-source-modal.tsx +++ b/src/renderer/src/pages/settings/add-download-source-modal.tsx @@ -65,7 +65,7 @@ export function AddDownloadSourceModal({ > setValue(e.target.value)} rightContent={ @@ -99,14 +99,16 @@ export function AddDownloadSourceModal({ >

{validationResult?.name}

- Found{" "} - {validationResult?.downloadCount.toLocaleString(undefined)}{" "} - download options + {t("found_download_option", { + count: validationResult?.downloadCount, + countFormatted: + validationResult?.downloadCount.toLocaleString(), + })} )}