From aa8b685108a029c4c406269440f35ba1b4347d31 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Sat, 14 Sep 2024 21:40:34 +0100 Subject: [PATCH] fix: adding translations for spanish --- src/locales/cs/translation.json | 5 - src/locales/de/translation.json | 5 - src/locales/en/translation.json | 17 ++- src/locales/es/translation.json | 61 +++++++-- src/locales/pt-BR/translation.json | 17 ++- src/locales/pt-PT/translation.json | 7 - src/locales/ru/translation.json | 62 +++++++-- .../profile/profile-content/friends-box.tsx | 20 ++- .../profile-content/profile-content.css.ts | 11 ++ .../profile-content/profile-content.tsx | 120 ++++++++++-------- .../profile/report-profile/report-profile.tsx | 4 +- .../src/pages/settings/settings-privacy.tsx | 7 +- 12 files changed, 231 insertions(+), 105 deletions(-) diff --git a/src/locales/cs/translation.json b/src/locales/cs/translation.json index e7cbbe6f..ba0e695d 100644 --- a/src/locales/cs/translation.json +++ b/src/locales/cs/translation.json @@ -260,11 +260,6 @@ "request_accepted": "Žádost přijata", "user_blocked_successfully": "Uživatel úspěšně zablokován", "user_block_modal_text": "Tohle zablokuje {{displayName}}", - "settings": "Nastavení", - "public": "Veřejné", - "private": "Soukromé", - "friends_only": "Pouze přátelé", - "privacy": "Soukromí", "blocked_users": "Zablokovaní uživatelé", "unblock": "Odblokovat", "no_friends_added": "Nemáš přidané žádné přátele", diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json index e8361961..cc2622aa 100644 --- a/src/locales/de/translation.json +++ b/src/locales/de/translation.json @@ -260,11 +260,6 @@ "request_accepted": "Anfrage akzeptiert", "user_blocked_successfully": "Nutzer erfolgreich blockiert", "user_block_modal_text": "{{displayName}} wird dadurch blockiert", - "settings": "Einstellungen", - "public": "Öffentlich", - "private": "Privat", - "friends_only": "Nur Freunde", - "privacy": "Privatsphäre", "blocked_users": "Blockierte Nutzer", "unblock": "Freigeben", "no_friends_added": "Du hast noch keine Freunde hinzugefügt", diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 4b9bd61a..f7bbd6c9 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -213,7 +213,9 @@ "profile_visibility_description": "Choose who can see your profile and library", "required_field": "This field is required", "source_already_exists": "This source has been already added", - "must_be_valid_url": "The source must be a valid URL" + "must_be_valid_url": "The source must be a valid URL", + "blocked_users": "Blocked users", + "user_unblocked": "User has been unblocked" }, "notifications": { "download_complete": "Download complete", @@ -296,6 +298,17 @@ "image_process_failure": "Failure while processing the image", "required_field": "This field is required", "displayname_min_length": "Display name must be at least 3 characters long", - "displayname_max_length": "Display name must be at most 50 characters long" + "displayname_max_length": "Display name must be at most 50 characters long", + "report_profile": "Report this profile", + "report_reason": "Why are you reporting this profile?", + "report_description": "Additional information", + "report_description_placeholder": "Additional information", + "report": "Report", + "report_reason_hate": "Hate speech", + "report_reason_sexual_content": "Sexual content", + "report_reason_violence": "Violence", + "report_reason_spam": "Spam", + "report_reason_other": "Other", + "profile_reported": "Profile reported" } } diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index d215ff71..ebac2f6e 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -7,7 +7,10 @@ "featured": "Destacado", "trending": "Tendencias", "surprise_me": "¡Sorpréndeme!", - "no_results": "No se encontraron resultados" + "no_results": "No se encontraron resultados", + "hot": "🔥 Caliente ahora", + "start_typing": "Empezando a escribir para buscar...", + "weekly": "📅 Los mejores juegos de la semana" }, "sidebar": { "catalogue": "Catálogo", @@ -21,7 +24,8 @@ "home": "Inicio", "queued": "{{title}} (En Cola)", "game_has_no_executable": "El juego no tiene un ejecutable", - "sign_in": "Iniciar sesión" + "sign_in": "Iniciar sesión", + "friends": "Amigos" }, "header": { "search": "Buscar juegos", @@ -114,7 +118,17 @@ "download_paused": "Descarga pausada", "last_downloaded_option": "Última opción descargada", "create_shortcut_success": "Atajo creado con éxito", - "create_shortcut_error": "Error al crear un atajo" + "create_shortcut_error": "Error al crear un atajo", + "allow_nsfw_content": "Continuar", + "download": "Descargar", + "download_count": "Descargas", + "download_error": "Esta opción de descarga no está disponible.", + "executable_path_in_use": "Ejecutable ya en uso por \"{{game}}\"", + "nsfw_content_description": "{{title}} incluye contenido que puede no ser adecuado para todas las edades. \n¿Estás seguro de que quieres continuar?", + "nsfw_content_title": "Este juego contiene contenido inapropiado.", + "player_count": "Jugadores activos", + "refuse_nsfw_content": "Volver", + "stats": "Estadísticas" }, "activation": { "title": "Activar Hydra", @@ -190,7 +204,21 @@ "found_download_option_zero": "No se encontró una opción de descarga", "found_download_option_one": "Se encontró {{countFormatted}} opción de descarga", "found_download_option_other": "Se encontraron {{countFormatted}} opciones de descarga", - "import": "Importar" + "import": "Importar", + "blocked_users": "Usuarios bloqueados", + "download_options_one": "", + "download_options_other": "", + "download_options_zero": "", + "friends_only": "solo amigos", + "must_be_valid_url": "La fuente debe ser una URL válida.", + "privacy": "Privacidad", + "private": "Privado", + "profile_visibility": "Visibilidad del perfil", + "profile_visibility_description": "Elige quién puede ver tu perfil y biblioteca", + "public": "Público", + "required_field": "Este campo es obligatorio", + "source_already_exists": "Esta fuente ya ha sido agregada.", + "user_unblocked": "El usuario ha sido desbloqueado" }, "notifications": { "download_complete": "Descarga completada", @@ -260,11 +288,6 @@ "request_accepted": "Solicitud aceptada", "user_blocked_successfully": "Usuario bloqueado exitosamente", "user_block_modal_text": "Esto va a bloquear a {{displayName}}", - "settings": "Ajustes", - "public": "Público", - "private": "Privado", - "friends_only": "Solo Amigos", - "privacy": "Privacidad", "blocked_users": "Usuarios bloqueados", "unblock": "Desbloquear", "no_friends_added": "Todavía no tienes amigos añadidos", @@ -272,6 +295,24 @@ "no_pending_invites": "No tienes invitaciones pendientes", "no_blocked_users": "No has bloqueado a ningún usuario", "friend_code_copied": "Código de amigo copiado", - "undo_friendship_modal_text": "Esto deshará tu amistad con {{displayName}}" + "undo_friendship_modal_text": "Esto deshará tu amistad con {{displayName}}", + "displayname_max_length": "El nombre para mostrar debe tener como máximo 50 caracteres", + "displayname_min_length": "El nombre para mostrar debe tener al menos 3 caracteres", + "image_process_failure": "Fallo al procesar la imagen.", + "locked_profile": "Este perfil es privado.", + "privacy_hint": "Para ajustar quién puede ver esto, ve a <0>Configuración.", + "profile_locked": "", + "profile_reported": "Perfil reportado", + "report": "Informe", + "report_description": "Información adicional", + "report_description_placeholder": "Información adicional", + "report_profile": "Reportar este perfil", + "report_reason": "¿Por qué estás denunciando este perfil?", + "report_reason_hate": "discurso de odio", + "report_reason_other": "Otro", + "report_reason_sexual_content": "Contenido sexual", + "report_reason_spam": "Correo basura", + "report_reason_violence": "Violencia", + "required_field": "Este campo es obligatorio" } } diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index 79d32ff7..198e37f4 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -212,7 +212,9 @@ "profile_visibility_description": "Escolha quem pode ver seu perfil e biblioteca", "required_field": "Este campo é obrigatório", "source_already_exists": "Essa fonte já foi adicionada", - "must_be_valid_url": "A fonte deve ser uma URL válida" + "must_be_valid_url": "A fonte deve ser uma URL válida", + "blocked_users": "Usuários bloqueados", + "user_unblocked": "Usuário desbloqueado" }, "notifications": { "download_complete": "Download concluído", @@ -300,6 +302,17 @@ "required_field": "Este campo é obrigatório", "displayname_min_length": "Nome de exibição deve ter pelo menos 3 caracteres", "displayname_max_length": "Nome de exibição deve ter no máximo 50 caracteres", - "locked_profile": "Este perfil é privado" + "locked_profile": "Este perfil é privado", + "report_profile": "Report this profile", + "report_reason": "Por que você deseja reportar este perfil?", + "report_description": "Informações adicionais", + "report_description_placeholder": "Insira aqui", + "report": "Reportar", + "report_reason_hate": "Discurso de ódio", + "report_reason_sexual_content": "Conteúdo sexual", + "report_reason_violence": "Violência", + "report_reason_spam": "Spam", + "report_reason_other": "Outro", + "profile_reported": "Perfil reportado" } } diff --git a/src/locales/pt-PT/translation.json b/src/locales/pt-PT/translation.json index f69ec184..c931070f 100644 --- a/src/locales/pt-PT/translation.json +++ b/src/locales/pt-PT/translation.json @@ -171,8 +171,6 @@ "save_changes": "Guardar alterações", "changes_saved": "Definições guardadas com sucesso", "download_sources_description": "O Hydra vai procurar links de transferência em todas as fontes ativadas. A URL da página de detalhes da loja não é guardada no seu dispositivo. Utilizamos um sistema de metadados criado pela comunidade para fornecer suporte a mais fontes de transferência de jogos.", - "enable_source": "Ativar", - "disable_source": "Desativar", "validate_download_source": "Validar", "remove_download_source": "Remover", "add_download_source": "Adicionar fonte", @@ -268,11 +266,6 @@ "request_accepted": "Pedido de amizade aceito", "user_blocked_successfully": "Utilizador bloqueado com sucesso", "user_block_modal_text": "Bloquear {{displayName}}", - "settings": "Definições", - "privacy": "Privacidade", - "private": "Privado", - "friends_only": "Apenas amigos", - "public": "Público", "blocked_users": "Utilizadores bloqueados", "unblock": "Desbloquear", "no_friends_added": "Ainda não adicionaste amigos", diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json index be3a000e..e3dfbad5 100644 --- a/src/locales/ru/translation.json +++ b/src/locales/ru/translation.json @@ -7,7 +7,10 @@ "featured": "Рекомендованное", "trending": "В тренде", "surprise_me": "Удиви меня", - "no_results": "Ничего не найдено" + "no_results": "Ничего не найдено", + "hot": "🔥 Сейчас жарко", + "start_typing": "Начинаю вводить текст для поиска...", + "weekly": "📅 Лучшие игры недели" }, "sidebar": { "catalogue": "Каталог", @@ -21,7 +24,8 @@ "home": "Главная", "queued": "{{title}} (В очереди)", "game_has_no_executable": "Файл запуска игры не выбран", - "sign_in": "Войти" + "sign_in": "Войти", + "friends": "Друзья" }, "header": { "search": "Поиск", @@ -114,7 +118,17 @@ "download_paused": "Загрузка приостановлена", "last_downloaded_option": "Последний вариант загрузки", "create_shortcut_success": "Ярлык создан", - "create_shortcut_error": "Не удалось создать ярлык" + "create_shortcut_error": "Не удалось создать ярлык", + "allow_nsfw_content": "Продолжать", + "download": "Скачать", + "download_count": "Загрузки", + "download_error": "Этот вариант загрузки недоступен", + "executable_path_in_use": "Исполняемый файл уже используется \"{{game}}\"", + "nsfw_content_description": "{{title}} содержит контент, который может не подходить для всех возрастов. \nВы уверены, что хотите продолжить?", + "nsfw_content_title": "Эта игра содержит неприемлемый контент", + "player_count": "Активные игроки", + "refuse_nsfw_content": "Возвращаться", + "stats": "Статистика" }, "activation": { "title": "Активировать Hydra", @@ -190,7 +204,21 @@ "found_download_option_zero": "Не найдено вариантов загрузки", "found_download_option_one": "Найден {{countFormatted}} вариант загрузки", "found_download_option_other": "Найдено {{countFormatted}} вариантов загрузки", - "import": "Импортировать" + "import": "Импортировать", + "blocked_users": "Заблокированные пользователи", + "download_options_one": "", + "download_options_other": "", + "download_options_zero": "", + "friends_only": "Только друзья", + "must_be_valid_url": "Источник должен быть действительным URL-адресом.", + "privacy": "Конфиденциальность", + "private": "Частный", + "profile_visibility": "Видимость профиля", + "profile_visibility_description": "Выберите, кто может видеть ваш профиль и библиотеку", + "public": "Общественный", + "required_field": "Это поле обязательно к заполнению", + "source_already_exists": "Этот источник уже добавлен", + "user_unblocked": "Пользователь разблокирован" }, "notifications": { "download_complete": "Загрузка завершена", @@ -260,17 +288,31 @@ "request_accepted": "Запрос принят", "user_blocked_successfully": "Пользователь успешно заблокирован", "user_block_modal_text": "{{displayName}} будет заблокирован", - "settings": "Настройки", - "public": "Публичный", - "private": "Приватный", - "friends_only": "Только друзья", - "privacy": "Приватность", "blocked_users": "Заблокированные пользователи", "unblock": "Разблокировать", "no_friends_added": "Вы ещё не добавили ни одного друга", "pending": "Ожидание", "no_pending_invites": "У вас нет запросов ожидающих ответа", "no_blocked_users": "Вы не заблокировали ни одного пользователя", - "friend_code_copied": "Код друга скопирован" + "friend_code_copied": "Код друга скопирован", + "displayname_max_length": "Отображаемое имя должно содержать не более 50 символов.", + "displayname_min_length": "Отображаемое имя должно содержать не менее 3 символов.", + "image_process_failure": "Сбой при обработке изображения", + "locked_profile": "Этот профиль является частным", + "privacy_hint": "Чтобы указать, кто может это видеть, перейдите в <0>Настройки.", + "profile_locked": "", + "profile_reported": "Профиль сообщил", + "report": "Отчет", + "report_description": "Дополнительная информация", + "report_description_placeholder": "Дополнительная информация", + "report_profile": "Пожаловаться на этот профиль", + "report_reason": "Почему вы жалуетесь на этот профиль?", + "report_reason_hate": "Разжигание ненависти", + "report_reason_other": "Другой", + "report_reason_sexual_content": "Сексуальный контент", + "report_reason_spam": "Спам", + "report_reason_violence": "Насилие", + "required_field": "Это поле обязательно к заполнению", + "undo_friendship_modal_text": "Это отменит вашу дружбу с {{displayName}}." } } diff --git a/src/renderer/src/pages/profile/profile-content/friends-box.tsx b/src/renderer/src/pages/profile/profile-content/friends-box.tsx index e2b4c9ba..151f9c80 100644 --- a/src/renderer/src/pages/profile/profile-content/friends-box.tsx +++ b/src/renderer/src/pages/profile/profile-content/friends-box.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import * as styles from "./profile-content.css"; import { Link } from "@renderer/components"; +import { PersonIcon } from "@primer/octicons-react"; export function FriendsBox() { const { userProfile, userStats } = useContext(userProfileContext); @@ -13,6 +14,8 @@ export function FriendsBox() { const { numberFormatter } = useFormat(); + if (!userProfile?.friends.length) return null; + return (
@@ -27,11 +30,18 @@ export function FriendsBox() { {userProfile?.friends.map((friend) => (
  • - {friend.displayName} + {friend.profileImageUrl ? ( + {friend.displayName} + ) : ( +
    + +
    + )} + {friend.displayName}
  • diff --git a/src/renderer/src/pages/profile/profile-content/profile-content.css.ts b/src/renderer/src/pages/profile/profile-content/profile-content.css.ts index 0c5aa04a..27c2a7fe 100644 --- a/src/renderer/src/pages/profile/profile-content/profile-content.css.ts +++ b/src/renderer/src/pages/profile/profile-content/profile-content.css.ts @@ -176,3 +176,14 @@ export const listItemDescription = style({ alignItems: "center", gap: `${SPACING_UNIT}px`, }); + +export const defaultAvatarWrapper = style({ + width: "32px", + height: "32px", + display: "flex", + justifyContent: "center", + alignItems: "center", + backgroundColor: vars.color.background, + border: `solid 1px ${vars.color.border}`, + borderRadius: "4px", +}); diff --git a/src/renderer/src/pages/profile/profile-content/profile-content.tsx b/src/renderer/src/pages/profile/profile-content/profile-content.tsx index 4a9ad201..a885bddf 100644 --- a/src/renderer/src/pages/profile/profile-content/profile-content.tsx +++ b/src/renderer/src/pages/profile/profile-content/profile-content.tsx @@ -57,17 +57,9 @@ export function ProfileContent() { return ; } - if (userProfile.libraryGames.length === 0) { - return ( -
    -
    - -
    -

    {t("no_recent_activity_title")}

    - {isMe &&

    {t("no_recent_activity_description")}

    } -
    - ); - } + const hasGames = userProfile?.libraryGames.length > 0; + + const shouldShowRightContent = hasGames || userProfile.friends.length > 0; return (
    -
    -

    {t("library")}

    + {!hasGames && ( +
    +
    + +
    +

    {t("no_recent_activity_title")}

    + {isMe &&

    {t("no_recent_activity_description")}

    } +
    + )} - {userStats && ( - {numberFormatter.format(userStats.libraryCount)} - )} -
    + {hasGames && ( + <> +
    +

    {t("library")}

    -
      - {userProfile?.libraryGames?.map((game) => ( -
    • -
    + +
      + {userProfile?.libraryGames?.map((game) => ( +
    • - -
    • - ))} -
    + className={styles.game} + > + + + ))} + + + )}
    -
    - - + {shouldShowRightContent && ( +
    + + - -
    + +
    + )}
    ); - }, [userProfile, isMe, usersAreFriends, numberFormatter, t, navigate]); + }, [ + userProfile, + isMe, + usersAreFriends, + userStats, + numberFormatter, + t, + navigate, + ]); return (
    diff --git a/src/renderer/src/pages/profile/report-profile/report-profile.tsx b/src/renderer/src/pages/profile/report-profile/report-profile.tsx index 758595f8..ff73a695 100644 --- a/src/renderer/src/pages/profile/report-profile/report-profile.tsx +++ b/src/renderer/src/pages/profile/report-profile/report-profile.tsx @@ -72,7 +72,7 @@ export function ReportProfile() { setShowReportProfileModal(false)} - title="Report this profile" + title={t("report_profile")} clickOutsideToClose={false} >
    ); }} @@ -122,6 +121,7 @@ export function ReportProfile() { type="button" className={styles.reportButton} onClick={() => setShowReportProfileModal(true)} + disabled={isSubmitting} > {t("report_profile")} diff --git a/src/renderer/src/pages/settings/settings-privacy.tsx b/src/renderer/src/pages/settings/settings-privacy.tsx index b6a4cb04..b93d1d07 100644 --- a/src/renderer/src/pages/settings/settings-privacy.tsx +++ b/src/renderer/src/pages/settings/settings-privacy.tsx @@ -57,16 +57,13 @@ export function SettingsPrivacy() { unblockUser(id) .then(() => { fetchBlockedUsers(); - // show toast - }) - .catch(() => { - //show toast + showSuccessToast(t("user_unblocked")); }) .finally(() => { setIsUnblocking(false); }); }, - [unblockUser, fetchBlockedUsers] + [unblockUser, fetchBlockedUsers, t, showSuccessToast] ); return (