Skip to content

Commit

Permalink
feat: replace hard coded string with i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
zamitto committed Jun 21, 2024
1 parent ac9df91 commit 6e2136e
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 11 deletions.
7 changes: 6 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
35 changes: 33 additions & 2 deletions src/locales/es/translation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"app": {
"successfully_signed_in": "Successfully signed in (TRANSLATE ME)"
},
"home": {
"featured": "Destacado",
"trending": "Tendencias",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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)"
}
}
7 changes: 6 additions & 1 deletion src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
35 changes: 33 additions & 2 deletions src/locales/ru/translation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"app": {
"successfully_signed_in": "Successfully signed in (TRANSLATE ME)"
},
"home": {
"featured": "Рекомендованное",
"trending": "В тренде",
Expand All @@ -16,7 +19,8 @@
"filter": "Фильтр библиотеки",
"home": "Главная",
"queued": "{{title}} (В очереди)",
"game_has_no_executable": "Файл запуска игры не выбран"
"game_has_no_executable": "Файл запуска игры не выбран",
"sign_in": "Sign in (TRANSLATE ME)"
},
"header": {
"search": "Поиск",
Expand Down Expand Up @@ -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": "Загрузка завершена",
Expand All @@ -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)"
}
}
12 changes: 7 additions & 5 deletions src/renderer/src/pages/settings/add-download-source-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function AddDownloadSourceModal({
>
<TextField
label={t("download_source_url")}
placeholder="Insert a valid JSON url"
placeholder={t("insert_valid_json_url")}
value={value}
onChange={(e) => setValue(e.target.value)}
rightContent={
Expand Down Expand Up @@ -99,14 +99,16 @@ export function AddDownloadSourceModal({
>
<h4>{validationResult?.name}</h4>
<small>
Found{" "}
{validationResult?.downloadCount.toLocaleString(undefined)}{" "}
download options
{t("found_download_option", {
count: validationResult?.downloadCount,
countFormatted:
validationResult?.downloadCount.toLocaleString(),
})}
</small>
</div>

<Button type="button" onClick={handleAddDownloadSource}>
Import
{t("import")}
</Button>
</div>
)}
Expand Down

0 comments on commit 6e2136e

Please sign in to comment.