feat: adding translation for catalogue

This commit is contained in:
Chubby Granny Chaser 2024-12-23 21:52:01 +00:00
parent 4aa7df65f5
commit d072a14aa3
No known key found for this signature in database
6 changed files with 44 additions and 15 deletions

View File

@ -46,8 +46,15 @@
"checking_files": "Checking {{title}} files… ({{percentage}} complete)"
},
"catalogue": {
"next_page": "Next page",
"previous_page": "Previous page"
"search": "Filter…",
"developers": "Developers",
"genres": "Genres",
"tags": "Tags",
"publishers": "Publishers",
"download_sources": "Download sources",
"result_count": "{{count}} results",
"filter_count": "{{count}} available",
"clear_filters": "Clear {{count}} selected"
},
"game_details": {
"open_download_options": "Open download options",

View File

@ -46,8 +46,15 @@
"checking_files": "Verificando archivos de {{title}}… ({{percentage}} completado)"
},
"catalogue": {
"next_page": "Siguiente página",
"previous_page": "Pagina anterior"
"search": "Filtrar…",
"developers": "Desarrolladores",
"genres": "Géneros",
"tags": "Marcadores",
"publishers": "Distribuidoras",
"download_sources": "Fuentes de descarga",
"result_count": "{{count}} resultados",
"filter_count": "{{count}} disponibles",
"clear_filters": "Limpiar {{count}} seleccionados"
},
"game_details": {
"open_download_options": "Ver opciones de descargas",

View File

@ -284,11 +284,15 @@
"instructions": "Verifique a forma correta de instalar algum deles no seu distro Linux, garantindo assim a execução normal do jogo"
},
"catalogue": {
"search": "Pesquisar…",
"search": "Filtrar…",
"developers": "Desenvolvedores",
"genres": "Gêneros",
"tags": "Tags",
"download_sources": "Fontes de download"
"tags": "Marcadores",
"publishers": "Distribuidoras",
"download_sources": "Fontes de download",
"result_count": "{{count}} resultados",
"filter_count": "{{count}} disponíveis",
"clear_filters": "Limpar {{count}} selecionados"
},
"modal": {
"close": "Botão de fechar"

View File

@ -46,8 +46,15 @@
"checking_files": "Проверка файлов {{title}}… ({{percentage}} завершено)"
},
"catalogue": {
"next_page": "Следующая страница",
"previous_page": "Предыдущая страница"
"search": "Фильтр…",
"developers": "Разработчики",
"genres": "Жанры",
"tags": "Маркеры",
"publishers": "Издательства",
"download_sources": "Источники загрузки",
"result_count": "{{count}} результатов",
"filter_count": "{{count}} доступных",
"clear_filters": "Очистить {{count}} выбранных"
},
"game_details": {
"open_download_options": "Открыть источники",

View File

@ -301,7 +301,9 @@ export default function Catalogue() {
marginTop: 16,
}}
>
<span>{formatNumber(itemsCount)} resultados</span>
<span style={{ fontSize: 12 }}>
{t("result_count", { count: formatNumber(itemsCount) })}
</span>
<Pagination
page={page}

View File

@ -3,6 +3,8 @@ import { useFormat } from "@renderer/hooks";
import { useCallback, useMemo, useState } from "react";
import List from "rc-virtual-list";
import { vars } from "@renderer/theme.css";
import { useTranslation } from "react-i18next";
export interface FilterSectionProps {
title: string;
@ -24,6 +26,7 @@ export function FilterSection({
onClear,
}: FilterSectionProps) {
const [search, setSearch] = useState("");
const { t } = useTranslation("catalogue");
const filteredItems = useMemo(() => {
if (search.length > 0) {
@ -64,7 +67,6 @@ export function FilterSection({
style={{
fontSize: 16,
fontWeight: 500,
color: "#fff",
}}
>
{title}
@ -78,22 +80,22 @@ export function FilterSection({
fontSize: 12,
marginBottom: 12,
display: "block",
color: "#fff",
color: vars.color.body,
cursor: "pointer",
textDecoration: "underline",
}}
onClick={onClear}
>
Limpar {formatNumber(selectedItemsCount)} selecionados
{t("clear_filters", { count: formatNumber(selectedItemsCount) })}
</button>
) : (
<span style={{ fontSize: 12, marginBottom: 12, display: "block" }}>
{formatNumber(items.length)} disponíveis
{t("filter_count", { count: formatNumber(items.length) })}
</span>
)}
<TextField
placeholder="Search..."
placeholder={t("search")}
onChange={(e) => onSearch(e.target.value)}
value={search}
containerProps={{ style: { marginBottom: 16 } }}