mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
refactor: Remove unused "repack_language_code" translations from multiple locale files
This commit is contained in:
parent
0333282915
commit
6053b7cd67
13 changed files with 18 additions and 106 deletions
|
@ -97,17 +97,6 @@
|
||||||
"copy_to_clipboard": "Copy",
|
"copy_to_clipboard": "Copy",
|
||||||
"copied_to_clipboard": "Copied",
|
"copied_to_clipboard": "Copied",
|
||||||
"got_it": "Got it",
|
"got_it": "Got it",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "English",
|
|
||||||
"es": "Spanish",
|
|
||||||
"fr": "French",
|
|
||||||
"hu": "Hungarian",
|
|
||||||
"it": "Italian",
|
|
||||||
"pl": "Polish",
|
|
||||||
"pt": "Portuguese",
|
|
||||||
"ru": "Russian",
|
|
||||||
"tr": "Turkish"
|
|
||||||
},
|
|
||||||
"multi_language": "Multi Language",
|
"multi_language": "Multi Language",
|
||||||
"multiplayer": "Multi Player"
|
"multiplayer": "Multi Player"
|
||||||
},
|
},
|
||||||
|
|
|
@ -94,17 +94,6 @@
|
||||||
"dont_show_it_again": "No mostrar de nuevo",
|
"dont_show_it_again": "No mostrar de nuevo",
|
||||||
"copy_to_clipboard": "Copiar",
|
"copy_to_clipboard": "Copiar",
|
||||||
"copied_to_clipboard": "Copiado",
|
"copied_to_clipboard": "Copiado",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "Inglés",
|
|
||||||
"es": "Español",
|
|
||||||
"fr": "Francés",
|
|
||||||
"hu": "Húngaro",
|
|
||||||
"it": "Italiano",
|
|
||||||
"pl": "Polaco",
|
|
||||||
"pt": "Portugués",
|
|
||||||
"ru": "Ruso",
|
|
||||||
"tr": "Turco"
|
|
||||||
},
|
|
||||||
"multi_language": "Multi Idioma",
|
"multi_language": "Multi Idioma",
|
||||||
"multiplayer": "Multijugador"
|
"multiplayer": "Multijugador"
|
||||||
},
|
},
|
||||||
|
|
|
@ -76,17 +76,6 @@
|
||||||
"deleting": "Suppression du programme d'installation…",
|
"deleting": "Suppression du programme d'installation…",
|
||||||
"playing_now": "Jeu en cours",
|
"playing_now": "Jeu en cours",
|
||||||
"last_time_played": "Dernièrement joué {{période}}",
|
"last_time_played": "Dernièrement joué {{période}}",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "Anglais",
|
|
||||||
"es": "Espagnol",
|
|
||||||
"fr": "Français",
|
|
||||||
"hu": "Hongrois",
|
|
||||||
"it": "Italien",
|
|
||||||
"pl": "Polonais",
|
|
||||||
"pt": "Portugais",
|
|
||||||
"ru": "Russe",
|
|
||||||
"tr": "Turc"
|
|
||||||
},
|
|
||||||
"multi_language": "Multilingue",
|
"multi_language": "Multilingue",
|
||||||
"multiplayer": "Multijoueur"
|
"multiplayer": "Multijoueur"
|
||||||
},
|
},
|
||||||
|
|
|
@ -85,17 +85,6 @@
|
||||||
"downloads_path": "Letöltések helye",
|
"downloads_path": "Letöltések helye",
|
||||||
"select_folder_hint": "Ahhoz, hogy megváltoztasd a helyet, hozzákell férned a",
|
"select_folder_hint": "Ahhoz, hogy megváltoztasd a helyet, hozzákell férned a",
|
||||||
"download_now": "Töltsd le most",
|
"download_now": "Töltsd le most",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "Angol",
|
|
||||||
"es": "Spanyol",
|
|
||||||
"fr": "Francia",
|
|
||||||
"hu": "Magyar",
|
|
||||||
"it": "Olasz",
|
|
||||||
"pl": "Lengyel",
|
|
||||||
"pt": "Portugál",
|
|
||||||
"ru": "Orosz",
|
|
||||||
"tr": "Török"
|
|
||||||
},
|
|
||||||
"multi_language": "Többnyelvű",
|
"multi_language": "Többnyelvű",
|
||||||
"multiplayer": "Többjátékos"
|
"multiplayer": "Többjátékos"
|
||||||
},
|
},
|
||||||
|
|
|
@ -98,17 +98,6 @@
|
||||||
"copy_to_clipboard": "Copia",
|
"copy_to_clipboard": "Copia",
|
||||||
"copied_to_clipboard": "Copiato",
|
"copied_to_clipboard": "Copiato",
|
||||||
"got_it": "Capito",
|
"got_it": "Capito",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "Inglese",
|
|
||||||
"es": "Spagnolo",
|
|
||||||
"fr": "Francese",
|
|
||||||
"hu": "Ungherese",
|
|
||||||
"it": "Italiano",
|
|
||||||
"pl": "Polacco",
|
|
||||||
"pt": "Portoghese",
|
|
||||||
"ru": "Russo",
|
|
||||||
"tr": "Turco"
|
|
||||||
},
|
|
||||||
"multi_language": "Multilingua",
|
"multi_language": "Multilingua",
|
||||||
"multiplayer": "Multigiocatore"
|
"multiplayer": "Multigiocatore"
|
||||||
},
|
},
|
||||||
|
|
|
@ -84,17 +84,6 @@
|
||||||
"select_folder_hint": "Aby zmienić domyślny folder, przejdź do",
|
"select_folder_hint": "Aby zmienić domyślny folder, przejdź do",
|
||||||
"settings": "Ustawienia Hydra",
|
"settings": "Ustawienia Hydra",
|
||||||
"download_now": "Pobierz teraz",
|
"download_now": "Pobierz teraz",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "Angielski",
|
|
||||||
"es": "Hiszpański",
|
|
||||||
"fr": "Francuski",
|
|
||||||
"hu": "Węgierski",
|
|
||||||
"it": "Włoski",
|
|
||||||
"pl": "Polski",
|
|
||||||
"pt": "Portugalski",
|
|
||||||
"ru": "Rosyjski",
|
|
||||||
"tr": "Turecki"
|
|
||||||
},
|
|
||||||
"multi_language": "Wielojęzyczny",
|
"multi_language": "Wielojęzyczny",
|
||||||
"multiplayer": "Wieloosobowy"
|
"multiplayer": "Wieloosobowy"
|
||||||
},
|
},
|
||||||
|
|
|
@ -93,17 +93,6 @@
|
||||||
"copy_to_clipboard": "Copiar",
|
"copy_to_clipboard": "Copiar",
|
||||||
"copied_to_clipboard": "Copiado",
|
"copied_to_clipboard": "Copiado",
|
||||||
"got_it": "Entendi",
|
"got_it": "Entendi",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "Inglês",
|
|
||||||
"es": "Espanhol",
|
|
||||||
"fr": "Francês",
|
|
||||||
"hu": "Húngaro",
|
|
||||||
"it": "Italiano",
|
|
||||||
"pl": "Polonês",
|
|
||||||
"pt": "Português",
|
|
||||||
"ru": "Russo",
|
|
||||||
"tr": "Turco"
|
|
||||||
},
|
|
||||||
"multi_language": "Multi Idioma",
|
"multi_language": "Multi Idioma",
|
||||||
"multiplayer": "Multijogador"
|
"multiplayer": "Multijogador"
|
||||||
},
|
},
|
||||||
|
|
|
@ -98,17 +98,6 @@
|
||||||
"copy_to_clipboard": "Копировать",
|
"copy_to_clipboard": "Копировать",
|
||||||
"copied_to_clipboard": "Скопировано",
|
"copied_to_clipboard": "Скопировано",
|
||||||
"got_it": "Понятно",
|
"got_it": "Понятно",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "Английский",
|
|
||||||
"es": "Испанский",
|
|
||||||
"fr": "Французский",
|
|
||||||
"hu": "Венгерский",
|
|
||||||
"it": "Итальянский",
|
|
||||||
"pl": "Польский",
|
|
||||||
"pt": "Португальский",
|
|
||||||
"ru": "Русский",
|
|
||||||
"tr": "Турецкий"
|
|
||||||
},
|
|
||||||
"multi_language": "Мультиязычный",
|
"multi_language": "Мультиязычный",
|
||||||
"multiplayer": "Многопользовательский"
|
"multiplayer": "Многопользовательский"
|
||||||
},
|
},
|
||||||
|
|
|
@ -97,17 +97,6 @@
|
||||||
"copy_to_clipboard": "Kopyala",
|
"copy_to_clipboard": "Kopyala",
|
||||||
"copied_to_clipboard": "Kopyalandı",
|
"copied_to_clipboard": "Kopyalandı",
|
||||||
"got_it": "Tamam",
|
"got_it": "Tamam",
|
||||||
"repack_language_code": {
|
|
||||||
"en": "İngilizce",
|
|
||||||
"es": "İspanyolca",
|
|
||||||
"fr": "Fransızca",
|
|
||||||
"hu": "Macarca",
|
|
||||||
"it": "İtalyanca",
|
|
||||||
"pl": "Polonyaca",
|
|
||||||
"pt": "Portekizce",
|
|
||||||
"ru": "Rusça",
|
|
||||||
"tr": "Türkçe"
|
|
||||||
},
|
|
||||||
"multi_language": "Çoklu Dil",
|
"multi_language": "Çoklu Dil",
|
||||||
"multiplayer": "Çok Oyunculu"
|
"multiplayer": "Çok Oyunculu"
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,10 +10,21 @@ export const supportMultiLanguage = (title: string) => {
|
||||||
return multiFollowedByDigitsRegex.test(title.toLowerCase());
|
return multiFollowedByDigitsRegex.test(title.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const languageCode = 'en';
|
||||||
|
// const displayNames = new Intl.DisplayNames([languageCode], { type: 'language' });
|
||||||
|
// const englishLanguage = displayNames.of(languageCode);
|
||||||
|
|
||||||
|
// console.log(englishLanguage); // Output: "English"
|
||||||
|
|
||||||
|
|
||||||
export const getRepackLanguageBasedOnRepacker = (repacker: string) => {
|
export const getRepackLanguageBasedOnRepacker = (repacker: string) => {
|
||||||
const repackMap = {
|
const languageCodes = {
|
||||||
'xatab': 'ru',
|
xatab: 'ru',
|
||||||
}
|
}
|
||||||
|
|
||||||
return repackMap[repacker.toLowerCase()] || 'en';
|
const languageCode = languageCodes[repacker.toLowerCase()] || 'en';
|
||||||
|
|
||||||
|
const displayNames = new Intl.DisplayNames([languageCode], { type: 'language' });
|
||||||
|
|
||||||
|
return displayNames.of(languageCode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ export function RepacksModal({
|
||||||
{repack.uploadDate
|
{repack.uploadDate
|
||||||
? format(repack.uploadDate, "dd/MM/yyyy")
|
? format(repack.uploadDate, "dd/MM/yyyy")
|
||||||
: ""}
|
: ""}
|
||||||
{" - " + t(`repack_language_code.${getRepackLanguageBasedOnRepacker(repack.repacker)}`)}
|
{" - " + getRepackLanguageBasedOnRepacker(repack.repacker)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<SeedersAndPeers
|
<SeedersAndPeers
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { GameRepack } from "@types";
|
import { GameRepack } from "@types";
|
||||||
import { Sprout, Users } from "lucide-react";
|
import { Sprout, Users } from "lucide-react";
|
||||||
|
|
||||||
import { useMagnetData } from "./useMagnetData";
|
import { useMagnetHealth } from "./useMagnetHealth";
|
||||||
import { Tooltip } from "@renderer/components/tooltip/tooltip";
|
import { Tooltip } from "@renderer/components/tooltip/tooltip";
|
||||||
import { SeedersAndPeersSkeleton } from "./seeders-and-peers-skeleton";
|
import { SeedersAndPeersSkeleton } from "./seeders-and-peers-skeleton";
|
||||||
import { vars } from "@renderer/theme.css";
|
import { vars } from "@renderer/theme.css";
|
||||||
|
@ -11,7 +11,7 @@ interface SeedersAndPeersProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SeedersAndPeers({ repack }: Readonly<SeedersAndPeersProps>) {
|
export function SeedersAndPeers({ repack }: Readonly<SeedersAndPeersProps>) {
|
||||||
const { magnetData, isLoading, error } = useMagnetData(repack.magnet);
|
const { magnetData, isLoading, error } = useMagnetHealth(repack.magnet);
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <SeedersAndPeersSkeleton />;
|
return <SeedersAndPeersSkeleton />;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { TorrentData } from "./types";
|
||||||
|
|
||||||
const cache: Record<string, TorrentData> = {};
|
const cache: Record<string, TorrentData> = {};
|
||||||
|
|
||||||
export function useMagnetData(magnet: string) {
|
export function useMagnetHealth(magnet: string) {
|
||||||
const [magnetData, setMagnetData] = useState<TorrentData | null>(
|
const [magnetData, setMagnetData] = useState<TorrentData | null>(
|
||||||
cache[magnet] || null
|
cache[magnet] || null
|
||||||
);
|
);
|
Loading…
Add table
Add a link
Reference in a new issue