feat: replace hard coded string with i18n

This commit is contained in:
Zamitto 2024-06-21 18:17:02 -03:00
parent ac9df910f8
commit 6e2136e155
5 changed files with 85 additions and 11 deletions

View File

@ -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",

View File

@ -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)"
}
}

View File

@ -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",

View File

@ -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)"
}
}

View File

@ -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={
@ -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>
)}