Merge branch 'release/v3.7.2'

This commit is contained in:
Zamitto
2025-10-31 13:58:14 -03:00
10 changed files with 30 additions and 26 deletions

View File

@@ -361,7 +361,10 @@
"show_original": "Show original", "show_original": "Show original",
"show_translation": "Show translation", "show_translation": "Show translation",
"show_original_translated_from": "Show original (translated from {{language}})", "show_original_translated_from": "Show original (translated from {{language}})",
"hide_original": "Hide original" "hide_original": "Hide original",
"review_from_blocked_user": "Review from blocked user",
"show": "Show",
"hide": "Hide"
}, },
"activation": { "activation": {
"title": "Activate Hydra", "title": "Activate Hydra",

View File

@@ -361,7 +361,10 @@
"you_seemed_to_enjoy_this_game": "Parece que has disfrutado de este juego", "you_seemed_to_enjoy_this_game": "Parece que has disfrutado de este juego",
"language": "Idioma", "language": "Idioma",
"caption": "Subtítulo", "caption": "Subtítulo",
"audio": "Audio" "audio": "Audio",
"review_from_blocked_user": "Reseña de usuario bloqueado",
"show": "Mostrar",
"hide": "Ocultar"
}, },
"activation": { "activation": {
"title": "Activar Hydra", "title": "Activar Hydra",

View File

@@ -349,7 +349,10 @@
"show_translation": "Mostrar tradução", "show_translation": "Mostrar tradução",
"show_original_translated_from": "Mostrar original (traduzido do {{language}})", "show_original_translated_from": "Mostrar original (traduzido do {{language}})",
"hide_original": "Ocultar original", "hide_original": "Ocultar original",
"rating_count": "Avaliação" "rating_count": "Avaliação",
"review_from_blocked_user": "Avaliação de usuário bloqueado",
"show": "Mostrar",
"hide": "Ocultar"
}, },
"activation": { "activation": {
"title": "Ativação", "title": "Ativação",

View File

@@ -180,7 +180,10 @@
"download_error_not_cached_on_torbox": "Este download não está disponível no TorBox e a verificação do status do download não está disponível.", "download_error_not_cached_on_torbox": "Este download não está disponível no TorBox e a verificação do status do download não está disponível.",
"game_removed_from_favorites": "Jogo removido dos favoritos", "game_removed_from_favorites": "Jogo removido dos favoritos",
"game_added_to_favorites": "Jogo adicionado aos favoritos", "game_added_to_favorites": "Jogo adicionado aos favoritos",
"create_start_menu_shortcut": "Criar atalho no Menu Iniciar" "create_start_menu_shortcut": "Criar atalho no Menu Iniciar",
"review_from_blocked_user": "Avaliação de utilizador bloqueado",
"show": "Mostrar",
"hide": "Ocultar"
}, },
"activation": { "activation": {
"title": "Ativação", "title": "Ativação",

View File

@@ -351,6 +351,8 @@
"audio": "Аудио", "audio": "Аудио",
"filter_by_source": "Фильтр по источнику", "filter_by_source": "Фильтр по источнику",
"no_repacks_found": "Источники для этой игры не найдены", "no_repacks_found": "Источники для этой игры не найдены",
"show": "Показать",
"hide": "Скрыть",
"delete_review": "Удалить отзыв", "delete_review": "Удалить отзыв",
"remove_review": "Удалить отзыв", "remove_review": "Удалить отзыв",
"delete_review_modal_title": "Вы уверены, что хотите удалить свой отзыв?", "delete_review_modal_title": "Вы уверены, что хотите удалить свой отзыв?",
@@ -361,7 +363,8 @@
"show_original": "Показать оригинал", "show_original": "Показать оригинал",
"show_translation": "Показать перевод", "show_translation": "Показать перевод",
"show_original_translated_from": "Показать оригинал (переведено с {{language}})", "show_original_translated_from": "Показать оригинал (переведено с {{language}})",
"hide_original": "Скрыть оригинал" "hide_original": "Скрыть оригинал",
"review_from_blocked_user": "Отзыв от заблокированного пользователя"
}, },
"activation": { "activation": {
"title": "Активировать Hydra", "title": "Активировать Hydra",

View File

@@ -60,7 +60,7 @@ export function Header() {
}; };
const handleSearch = (value: string) => { const handleSearch = (value: string) => {
dispatch(setFilters({ title: value })); dispatch(setFilters({ title: value.slice(0, 255) }));
if (!location.pathname.startsWith("/catalogue")) { if (!location.pathname.startsWith("/catalogue")) {
navigate("/catalogue"); navigate("/catalogue");

View File

@@ -35,7 +35,7 @@ export default function Catalogue() {
const { steamDevelopers, steamPublishers, downloadSources } = useCatalogue(); const { steamDevelopers, steamPublishers, downloadSources } = useCatalogue();
const { steamGenres, steamUserTags } = useAppSelector( const { steamGenres, steamUserTags, filters, page } = useAppSelector(
(state) => state.catalogueSearch (state) => state.catalogueSearch
); );
@@ -47,8 +47,6 @@ export default function Catalogue() {
const { formatNumber } = useFormat(); const { formatNumber } = useFormat();
const { filters, page } = useAppSelector((state) => state.catalogueSearch);
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const { t, i18n } = useTranslation("catalogue"); const { t, i18n } = useTranslation("catalogue");

View File

@@ -163,7 +163,6 @@ export function GameReviews({
take: "20", take: "20",
skip: skip.toString(), skip: skip.toString(),
sortBy: reviewsSortBy, sortBy: reviewsSortBy,
language: i18n.language,
}); });
const response = await window.electron.hydraApi.get( const response = await window.electron.hydraApi.get(

View File

@@ -71,25 +71,18 @@ export function ReviewItem({
const [showOriginal, setShowOriginal] = useState(false); const [showOriginal, setShowOriginal] = useState(false);
// Check if this is the user's own review
const isOwnReview = userDetailsId === review.user.id; const isOwnReview = userDetailsId === review.user.id;
// Helper to get base language code (e.g., "pt" from "pt-BR") const getBaseLanguage = (lang: string | null) => lang?.split("-")[0] || "";
const getBaseLanguage = (lang: string) => lang.split("-")[0];
// Check if the review is in a different language (comparing base language codes)
const isDifferentLanguage = const isDifferentLanguage =
getBaseLanguage(review.detectedLanguage) !== getBaseLanguage(i18n.language); getBaseLanguage(review.detectedLanguage) !== getBaseLanguage(i18n.language);
// Check if translation is available and needed (but not for own reviews)
const needsTranslation = const needsTranslation =
!isOwnReview && !isOwnReview && isDifferentLanguage && review.translations[i18n.language];
isDifferentLanguage &&
review.translations &&
review.translations[i18n.language];
// Get the full language name using Intl.DisplayNames const getLanguageName = (languageCode: string | null) => {
const getLanguageName = (languageCode: string) => { if (!languageCode) return "";
try { try {
const displayNames = new Intl.DisplayNames([i18n.language], { const displayNames = new Intl.DisplayNames([i18n.language], {
type: "language", type: "language",
@@ -100,7 +93,6 @@ export function ReviewItem({
} }
}; };
// Determine which content to show - always show original for own reviews
const displayContent = needsTranslation const displayContent = needsTranslation
? review.translations[i18n.language] ? review.translations[i18n.language]
: review.reviewHtml; : review.reviewHtml;
@@ -109,12 +101,12 @@ export function ReviewItem({
return ( return (
<div className="game-details__review-item"> <div className="game-details__review-item">
<div className="game-details__blocked-review-simple"> <div className="game-details__blocked-review-simple">
Review from blocked user {" "} {t("review_from_blocked_user")}
<button <button
className="game-details__blocked-review-show-link" className="game-details__blocked-review-show-link"
onClick={() => onToggleVisibility(review.id)} onClick={() => onToggleVisibility(review.id)}
> >
Show {t("show")}
</button> </button>
</div> </div>
</div> </div>
@@ -323,7 +315,7 @@ export function ReviewItem({
className="game-details__blocked-review-hide-link" className="game-details__blocked-review-hide-link"
onClick={() => onToggleVisibility(review.id)} onClick={() => onToggleVisibility(review.id)}
> >
Hide {t("hide")}
</button> </button>
)} )}
</div> </div>

View File

@@ -252,7 +252,7 @@ export interface GameReview {
translations: { translations: {
[key: string]: string; [key: string]: string;
}; };
detectedLanguage: string; detectedLanguage: string | null;
} }
export interface TrendingGame extends ShopAssets { export interface TrendingGame extends ShopAssets {