diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 4a6ac099..9360294c 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -15,6 +15,19 @@ "desktop": "Mode Bureau", "debug": "Mode Debug" }, + "maps":{ + "search-bar":{ + "search-placeholder": "Rechercher une map", + "filters-btn":"Filtres", + "dropdown":{ + "export-maps": "Exporter les maps", + "delete-maps": "Supprimer les maps" + } + }, + "maps-panel":{ + + } + }, "mods":{ "loading-mods": "Chargement des mods...", "buttons":{ @@ -392,6 +405,69 @@ } } }, + "maps":{ + "map-filter-panel":{ + "duration": "Durée", + "tags": "tags", + "specificities": "général", + "requirements": "requis" + }, + "map-types":{ + "accuracy": "précision", + "balanced": "équilibrée", + "challenge": "challenge", + "dancestyle": "dance", + "fitness": "fitness", + "speed": "vitesse", + "tech": "tech" + }, + "map-styles":{ + "dance": "dance", + "swing": "swing", + "nightcore": "nightcore", + "folk": "Folk", + "family": "Famille", + "ambient": "ambiante", + "funk": "funk", + "jazz": "jazz", + "soul": "soul", + "speedcore": "speedcore", + "punk": "punk", + "rb": "r&b", + "holiday": "vacance", + "vocaloid": "vocaloid", + "jrock": "j-rock", + "trance": "trance", + "drumbass": "drum & bass", + "comedy": "comédie", + "instrumental": "instrumental", + "hardcore": "hardcore", + "kpop": "k-pop", + "indie": "indé", + "techno": "techno", + "house": "house", + "game": "jeu vidéo", + "film": "film", + "alt": "alternative", + "dubstep": "dubstep", + "metal": "metal", + "anime": "anime", + "hiphop": "hiphop", + "jpop": "j-pop", + "rock": "rock", + "pop": "pop", + "electronic": "éléctronique", + "classical-orchestral": "Classique & Orchestral" + }, + "map-specificities":{ + "automapper": "ia", + "ranked": "classée", + "curated": "recommandée", + "verified": "vérifiée", + "fullSpread": "panel complet" + } + + }, "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 403c27dc..49d16da6 100644 --- a/src/renderer/components/maps-mangement-components/filter-panel.component.tsx +++ b/src/renderer/components/maps-mangement-components/filter-panel.component.tsx @@ -1,4 +1,4 @@ -import { MapFilter, MapTag } from "shared/models/maps/beat-saver.model" +import { MapFilter, MapSpecificity, MapStyle, MapTag, MapType } from "shared/models/maps/beat-saver.model" import {motion} from "framer-motion" import { MutableRefObject} from "react" import { MAP_TYPES } from "renderer/partials/maps/map-tags/map-types" @@ -8,6 +8,9 @@ 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" export type Props = { className?: string, @@ -19,6 +22,8 @@ export type Props = { export function FilterPanel({className, ref, playlist = false, filter, onChange}: Props) { + const t = useTranslation(); + const MIN_NPS = 0; const MAX_NPS = 17; @@ -34,7 +39,7 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange} const renderDurationLabel = (sec: number): JSX.Element => { const textValue = (() => { - if(sec === MIN_DURATION){ return "Durée"; } //TODO TRADUIRE + if(sec === MIN_DURATION){ return t("maps.map-filter-panel.duration"); } if(sec === MAX_DURATION){ return "∞"; } const date = new Date(0); date.setSeconds(sec); @@ -104,6 +109,18 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange} } + const translateMapType = (type: MapType): string => { + return t(`maps.map-types.${type}`); + } + + const translateMapStyle = (style: MapStyle): string => { + return t(`maps.map-styles.${style}`) + } + + const translateMapSpecificity = (specificity: MapSpecificity): string => { + return t(`maps.map-specificities.${specificity}`); + } + type BooleanKeys = { [k in keyof T]: T[k] extends boolean ? k : never }[keyof T]; const handleCheckbox = (key: BooleanKeys) => { @@ -125,56 +142,34 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange}
{/* TODO TRADUIRE */}
-

general

-
handleCheckbox("automapper")}> - handleCheckbox("automapper")}/> - AI -
-
handleCheckbox("ranked")}> - handleCheckbox("ranked")}/> - Rancked -
-
handleCheckbox("curated")}> - handleCheckbox("curated")}/> - Curated -
-
handleCheckbox("verified")}> - handleCheckbox("verified")}/> - Verified Mapper -
-
handleCheckbox("fullSpread")}> - handleCheckbox("fullSpread")}/> - Full Spread -
-

requirements

-
handleCheckbox("chroma")}> - handleCheckbox("chroma")}/> - Chroma -
-
handleCheckbox("noodle")}> - handleCheckbox("noodle")}/> - Noodle -
-
handleCheckbox("me")}> - handleCheckbox("me")}/> - Me -
-
handleCheckbox("cinema")}> - handleCheckbox("cinema")}/> - Cinema -
+ +

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

+ {MAP_SPECIFICITIES.map(specificity => ( +
handleCheckbox(specificity)}> + handleCheckbox(specificity)}/> + {translateMapSpecificity(specificity)} +
+ ))} + +

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

+ {MAP_REQUIREMENTS.map(requirement => ( +
handleCheckbox(requirement)}> + handleCheckbox(requirement)}/> + {requirement} +
+ ))}
-

TAGS

+

{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}}>{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)} ))}
{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}}>{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)} ))}
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 f8bfe633..80d7713d 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 @@ -15,6 +15,7 @@ import wipGif from "../../../../assets/images/gifs/wip.gif" import { OsDiagnosticService } from "renderer/services/os-diagnostic.service" import { useObservable } from "renderer/hooks/use-observable.hook" import { BsmIcon } from "../svgs/bsm-icon.component" +import { useTranslation } from "renderer/hooks/use-translation.hook" type Props = { version?: BSVersion @@ -33,6 +34,7 @@ export function MapsPlaylistsPanel({version}: Props) { const [mapsLinked, setMapsLinked] = useState(false); const isOnline = useObservable(osDiagnostic.isOnline$); const color = useThemeColor("first-color"); + const t = useTranslation(); const mapsRef = useRef(); useEffect(() => { @@ -110,8 +112,8 @@ export function MapsPlaylistsPanel({version}: Props) { ] } return [ - {icon:"export", text: "Exporter les maps", onClick: () => mapsRef.current.exportMaps?.()}, - {icon: "trash", text: "Supprimer les maps", onClick: () => mapsRef.current.deleteMaps?.()} + {icon:"export", text: "pages.version-viewer.maps.search-bar.dropdown.export-maps", onClick: () => mapsRef.current.exportMaps?.()}, + {icon: "trash", text: "pages.version-viewer.maps.search-bar.dropdown.delete-maps", onClick: () => mapsRef.current.deleteMaps?.()} ] })() @@ -120,9 +122,9 @@ export function MapsPlaylistsPanel({version}: Props) {