diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 30b2f8b1..77732884 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -5,6 +5,7 @@ "launch": "Launch", "mods": "Mods", "maps": "Maps", + "playlists":"Playlists", "cancel": "Cancel", "delete": "Delete" }, @@ -15,6 +16,32 @@ "desktop": "Desktop Mod", "debug": "Debug Mod" }, + "maps":{ + "search-bar":{ + "search-placeholder": "Search a map", + "filters-btn":"Filters", + "dropdown":{ + "export-maps": "Export maps", + "delete-maps": "Delete maps" + } + }, + "tabs":{ + "maps":{ + "actions":{ + "add-maps":{ + "text": "Add" + }, + "link-maps":{ + "tooltips":{ + "link": "Link maps", + "unlink": "Unling maps" + } + } + } + + } + } + }, "mods":{ "loading-mods": "Loading mods...", "buttons":{ @@ -390,8 +417,93 @@ }, "valid-btn":"Unlink maps" } + }, + "download-maps":{ + "search-btn": "Search", + "loading-maps": "Loading maps..." } - }, + }, + "maps":{ + "map-filter-panel":{ + "duration": "Duration", + "tags": "tags", + "specificities": "general", + "requirements": "requirements" + }, + "map-types":{ + "accuracy": "accuracy", + "balanced": "balanced", + "challenge": "challenge", + "dancestyle": "dance", + "fitness": "fitness", + "speed": "speed", + "tech": "tech" + }, + "map-styles":{ + "dance": "dance", + "swing": "swing", + "nightcore": "nightcore", + "folk": "folk", + "family": "family", + "ambient": "ambient", + "funk": "funk", + "jazz": "jazz", + "soul": "soul", + "speedcore": "speedcore", + "punk": "punk", + "rb": "r&b", + "holiday": "holiday", + "vocaloid": "vocaloid", + "jrock": "j-rock", + "trance": "trance", + "drumbass": "drum & bass", + "comedy": "comedy", + "instrumental": "instrumental", + "hardcore": "hardcore", + "kpop": "k-pop", + "indie": "indie", + "techno": "techno", + "house": "house", + "game": "video game", + "film": "film", + "alt": "alternative", + "dubstep": "dubstep", + "metal": "metal", + "anime": "anime", + "hiphop": "hiphop", + "jpop": "j-pop", + "rock": "rock", + "pop": "pop", + "electronic": "electronic", + "classical-orchestral": "Classical & Orchestral" + }, + "map-specificities":{ + "automapper": "AI", + "ranked": "ranked", + "curated": "curated", + "verified": "verified", + "fullSpread": "full spread" + }, + "difficulties":{ + "Easy": "easy", + "Normal": "normal", + "Hard": "hard", + "Expert": "expert", + "ExpertPlus": "expert+" + }, + "map-item":{ + "by": "By {songAutor}", + "mapped-by":"mapped by" + } + }, + "beat-saver":{ + "maps-sorts":{ + "Latest": "Latest", + "Relevance": "Relevance", + "Rating": "Rating", + "Curated": "Curated" + } + }, "auto-update":{ "checking": "Checking for updates", "downloading": "Downloading updates" diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index 4f26ddfa..99de5510 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -4,7 +4,8 @@ "verify": "Verificar", "launch": "Lanzar", "mods": "Mods", - "maps": "Maps", + "maps": "Mapas", + "playlists":"Playlists", "cancel": "Cancelar", "delete": "Borrar" }, @@ -15,6 +16,32 @@ "desktop": "Desktop Mod", "debug": "Debug Mod" }, + "maps":{ + "search-bar":{ + "search-placeholder": "Buscar en un mapa", + "filters-btn":"Filtros", + "dropdown":{ + "export-maps": "Exportar mapas", + "delete-maps": "Borrar mapas" + } + }, + "tabs":{ + "maps":{ + "actions":{ + "add-maps":{ + "text": "Añadir" + }, + "link-maps":{ + "tooltips":{ + "link": "Vincular los mapas", + "unlink": "Desatar los mapas" + } + } + } + + } + } + }, "mods":{ "loading-mods": "Cargando mods...", "buttons":{ @@ -391,8 +418,93 @@ }, "valid-btn":"Desvincular mapas" } + }, + "download-maps":{ + "search-btn": "buscar", + "loading-maps": "Cargando mapas..." } - }, + }, + "maps":{ + "map-filter-panel":{ + "duration": "Duración", + "tags": "tags", + "specificities": "general", + "requirements": "requisitos" + }, + "map-types":{ + "accuracy": "precisión", + "balanced": "equilibrado", + "challenge": "desafío", + "dancestyle": "baile", + "fitness": "fitness", + "speed": "speed", + "tech": "tec" + }, + "map-styles":{ + "dance": "baile", + "swing": "swing", + "nightcore": "nightcore", + "folk": "folk", + "family": "familia", + "ambient": "ambiente", + "funk": "funk", + "jazz": "jazz", + "soul": "soul", + "speedcore": "speedcore", + "punk": "punk", + "rb": "r&b", + "holiday": "vacaciones", + "vocaloid": "vocaloid", + "jrock": "j-rock", + "trance": "trance", + "drumbass": "drum & bass", + "comedy": "comedia", + "instrumental": "instrumental", + "hardcore": "hardcore", + "kpop": "k-pop", + "indie": "indie", + "techno": "tecno", + "house": "house", + "game": "videojuego", + "film": "film", + "alt": "alternativa", + "dubstep": "dubstep", + "metal": "metal", + "anime": "anime", + "hiphop": "hiphop", + "jpop": "j-pop", + "rock": "rock", + "pop": "pop", + "electronic": "electrónico", + "classical-orchestral": "Clásico y orquestal" + }, + "map-specificities":{ + "automapper": "IA", + "ranked": "ranked", + "curated": "recomendado", + "verified": "verificado", + "fullSpread": "panel completo" + }, + "difficulties":{ + "Easy": "fácil", + "Normal": "normal", + "Hard": "difícil", + "Expert": "experto", + "ExpertPlus": "experto+" + }, + "map-item":{ + "by": "Por {songAutor}", + "mapped-by":"mapeado por" + } + }, + "beat-saver":{ + "maps-sorts":{ + "Latest": "Última", + "Relevance": "Relevancia", + "Rating": "Notas", + "Curated": "Recomendado" + } + }, "auto-update":{ "checking": "Comprobar las actualizaciones", "downloading": "Descargar actualizaciones" diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 9360294c..a95365bb 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -5,6 +5,7 @@ "launch": "Lancer", "mods": "Mods", "maps": "Maps", + "playlists":"Playlists", "cancel": "Annuler", "delete": "Supprimer" }, @@ -24,8 +25,21 @@ "delete-maps": "Supprimer les maps" } }, - "maps-panel":{ - + "tabs":{ + "maps":{ + "actions":{ + "add-maps":{ + "text": "Ajouter" + }, + "link-maps":{ + "tooltips":{ + "link": "Lier les maps", + "unlink": "Délier les maps" + } + } + } + + } } }, "mods":{ @@ -403,9 +417,13 @@ }, "valid-btn":"délier les maps" } + }, + "download-maps":{ + "search-btn": "Rechercher", + "loading-maps": "Chargement des maps..." } - }, - "maps":{ + }, + "maps":{ "map-filter-panel":{ "duration": "Durée", "tags": "tags", @@ -425,8 +443,8 @@ "dance": "dance", "swing": "swing", "nightcore": "nightcore", - "folk": "Folk", - "family": "Famille", + "folk": "folk", + "family": "famille", "ambient": "ambiante", "funk": "funk", "jazz": "jazz", @@ -460,14 +478,32 @@ "classical-orchestral": "Classique & Orchestral" }, "map-specificities":{ - "automapper": "ia", + "automapper": "IA", "ranked": "classée", "curated": "recommandée", "verified": "vérifiée", "fullSpread": "panel complet" + }, + "difficulties":{ + "Easy": "facile", + "Normal": "normal", + "Hard": "difficile", + "Expert": "expert", + "ExpertPlus": "expert+" + }, + "map-item":{ + "by": "Par {songAutor}", + "mapped-by":"mappée par" } - - }, + }, + "beat-saver":{ + "maps-sorts":{ + "Latest": "Dernière", + "Relevance": "Pertinence", + "Rating": "Notes", + "Curated": "Recommandée" + } + }, "auto-update":{ "checking": "Vérification des mises à jour", "downloading": "Téléchargement des mises à jour" diff --git a/src/renderer/components/maps-mangement-components/filter-panel.component.tsx b/src/renderer/components/maps-mangement-components/filter-panel.component.tsx index 49d16da6..3c3e72a4 100644 --- a/src/renderer/components/maps-mangement-components/filter-panel.component.tsx +++ b/src/renderer/components/maps-mangement-components/filter-panel.component.tsx @@ -4,13 +4,13 @@ import { MutableRefObject} from "react" import { MAP_TYPES } from "renderer/partials/maps/map-tags/map-types" import { MAP_STYLES } from "renderer/partials/maps/map-tags/map-styles" import { BsmCheckbox } from "../shared/bsm-checkbox.component" -import { diffColors } from "./map-item.component" import { min_to_s } from "renderer/helpers/time-utils" import dateFormat from "dateformat" import { BsmRange } from "../shared/bsm-range.component" import { useTranslation } from "renderer/hooks/use-translation.hook" import { MAP_SPECIFICITIES } from "renderer/partials/maps/map-general/map-specificity" import { MAP_REQUIREMENTS } from "renderer/partials/maps/map-requirements/map-requirements" +import { MAP_DIFFICULTIES_COLORS } from "renderer/partials/maps/map-difficulties/map-difficulties-colors" export type Props = { className?: string, @@ -136,11 +136,11 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange} return !playlist ? ( -
+
-
{/* TODO TRADUIRE */} +

{t("maps.map-filter-panel.specificities")}

@@ -164,12 +164,12 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange}

{t("maps.map-filter-panel.tags")}

{MAP_TYPES.map(tag => ( - handleTagClick(tag)} className={`text-[12.5px] text-black rounded-md px-1 font-bold cursor-pointer ${(!isTagActivated(tag)) && "opacity-40 hover:opacity-90"}`} style={{backgroundColor: isTagExcluded(tag) ? diffColors.Expert : diffColors.Normal}}>{translateMapType(tag)} + handleTagClick(tag)} className={`text-[12.5px] text-black rounded-md px-1 font-bold cursor-pointer ${(!isTagActivated(tag)) && "opacity-40 hover:opacity-90"}`} style={{backgroundColor: isTagExcluded(tag) ? MAP_DIFFICULTIES_COLORS.Expert : MAP_DIFFICULTIES_COLORS.Normal}}>{translateMapType(tag)} ))}
{MAP_STYLES.map(tag => ( - handleTagClick(tag)} className={`text-[12.5px] text-black rounded-md px-1 font-bold cursor-pointer ${(!isTagActivated(tag)) && "opacity-40 hover:opacity-90"}`} style={{backgroundColor: isTagExcluded(tag) ? diffColors.Expert : diffColors.Easy}}>{translateMapStyle(tag)} + handleTagClick(tag)} className={`text-[12.5px] text-black rounded-md px-1 font-bold cursor-pointer ${(!isTagActivated(tag)) && "opacity-40 hover:opacity-90"}`} style={{backgroundColor: isTagExcluded(tag) ? MAP_DIFFICULTIES_COLORS.Expert : MAP_DIFFICULTIES_COLORS.Easy}}>{translateMapStyle(tag)} ))}
diff --git a/src/renderer/components/maps-mangement-components/map-item.component.tsx b/src/renderer/components/maps-mangement-components/map-item.component.tsx index e9e89a72..a46e7c4c 100644 --- a/src/renderer/components/maps-mangement-components/map-item.component.tsx +++ b/src/renderer/components/maps-mangement-components/map-item.component.tsx @@ -17,6 +17,9 @@ import equal from "fast-deep-equal/es6"; import { getMapZipUrlFromHash } from "renderer/helpers/maps-utils"; import { BsmBasicSpinner } from "../shared/bsm-basic-spinner/bsm-basic-spinner.component"; import defaultImage from '../../../../assets/images/default-version-img.jpg' +import { useTranslation } from "renderer/hooks/use-translation.hook"; +import { MAP_DIFFICULTIES } from "renderer/partials/maps/map-difficulties/map-difficulties"; +import { MAP_DIFFICULTIES_COLORS } from "renderer/partials/maps/map-difficulties/map-difficulties-colors" export type ParsedMapDiff = {type: BsvMapDifficultyType, name: string, stars: number} @@ -51,6 +54,7 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl, const audioPlayer = AudioPlayerService.getInstance(); const color = useThemeColor("first-color"); + const t = useTranslation(); const [hovered, setHovered] = useState(false); const [bottomBarHovered, setBottomBarHovered, cancelBottomBarHovered] = useDelayedState(false); @@ -73,7 +77,9 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl, })(); const parseDiffLabel = (diffLabel: string) => { - if(diffLabel === "ExpertPlus"){ return "Expert+" } + if(MAP_DIFFICULTIES.includes(diffLabel as BsvMapDifficultyType)){ + return t(`maps.difficulties.${diffLabel}`); + } return diffLabel; } @@ -115,7 +121,7 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
{diffSet.map(diff => ( - + ))}
@@ -142,16 +148,16 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl, {diffSet.map(({type, name, stars}) => (
  • - + { stars ? ( ★ {stars} ) : ( - {parseDiffLabel(type)} + {parseDiffLabel(type)} ) } - {parseDiffLabel(name)} + {parseDiffLabel(name)}
  • ))} @@ -170,8 +176,8 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,

    {title}

    -

    par {songAutor}

    -

    {autor && (<> mappée par {autor})}

    +

    {songAutor && t("maps.map-item.by", {songAutor})}

    +

    {autor && (<> {t("maps.map-item.mapped-by")} {autor})}

    {likesText && (
    @@ -195,7 +201,7 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl, {ranked && (
    - classée + {t("maps.map-specificities.ranked")}
    )}
    @@ -225,11 +231,3 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl, function areEqual(prevProps: MapItemProps, nextProps: MapItemProps): boolean { return equal(prevProps, nextProps); } - -export const diffColors: Record = { - Easy: "#00FF9E", - Normal: "#00FFFF", - Hard: "#FFA700", - Expert: "#FF4319", - ExpertPlus: "#FF7EFF" -} diff --git a/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx b/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx index af6de4ce..ecdc8a80 100644 --- a/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx +++ b/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx @@ -5,7 +5,6 @@ import { LocalMapsListPanel } from "./local-maps-list-panel.component" import { BsmDropdownButton, DropDownItem } from "../shared/bsm-dropdown-button.component" import { FilterPanel } from "./filter-panel.component" import { MapFilter } from "shared/models/maps/beat-saver.model" -import { BsmButton } from "../shared/bsm-button.component" import { useThemeColor } from "renderer/hooks/use-theme-color.hook" import { MapsManagerService } from "renderer/services/maps-manager.service" import { motion, Variants } from "framer-motion"; @@ -88,11 +87,11 @@ export function MapsPlaylistsPanel({version}: Props) { - Ajouter + {t("pages.version-viewer.maps.tabs.maps.actions.add-maps.text")} )} {(!!version) && ( - {e.stopPropagation(); onClickLink(index)}}> + {e.stopPropagation(); onClickLink(index)}}> @@ -119,7 +118,7 @@ export function MapsPlaylistsPanel({version}: Props) { return (
    -