From 1d70c867f3db8df704d9d5ebd113444dc679f671 Mon Sep 17 00:00:00 2001 From: silentrald Date: Wed, 8 Jan 2025 21:31:39 +0800 Subject: [PATCH] [feat-216] fix ui issues + change some dropdown options --- assets/jsons/translations/de.json | 35 +++++++++---------- assets/jsons/translations/en.json | 35 +++++++++---------- assets/jsons/translations/es.json | 35 +++++++++---------- assets/jsons/translations/fr.json | 35 +++++++++---------- assets/jsons/translations/it.json | 16 +++++++++ assets/jsons/translations/ja.json | 35 +++++++++---------- assets/jsons/translations/ko.json | 16 +++++++++ assets/jsons/translations/ru.json | 35 +++++++++---------- assets/jsons/translations/zh-tw.json | 35 +++++++++---------- assets/jsons/translations/zh.json | 35 +++++++++---------- .../maps-playlists-panel.component.tsx | 10 +++--- .../services/playlists/sorter.service.ts | 9 +---- 12 files changed, 166 insertions(+), 165 deletions(-) diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json index 3ba20a8d..f93db3ac 100644 --- a/assets/jsons/translations/de.json +++ b/assets/jsons/translations/de.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "Deine Karten importieren", "subtext": "Lasse deine ZIP-Dateien hier fallen, um deine Karten zu importieren" + }, + "sort": { + "name": "Name", + "song-author": "Liedautor", + "map-author": "Kartenautor", + "bpm": "BPM", + "duration": "Dauer", + "likes": "Likes", + "date-uploaded": "Hochladedatum" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "Importiere deine Wiedergabelisten", "subtext": "Ziehe deine \".bplist\" oder \".json\" Dateien hierhin, um sie zu importieren" + }, + "sort": { + "title": "Titel", + "author": "Autor", + "number-of-maps": "Anzahl der Karten", + "duration": "Dauer", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "Name", - "song-author": "Liedautor", - "map-author": "Kartenautor", - "bpm": "BPM", - "duration": "Dauer", - "likes": "Likes", - "date-uploaded": "Hochladedatum" - } - }, - "playlists": { - "sort": { - "title": "Titel", - "author": "Autor", - "number-of-maps": "Anzahl der Karten", - "duration": "Dauer", - "min-notes-per-second": "Minimale Noten pro Sekunde", - "max-notes-per-second": "Maximale Noten pro Sekunde" } }, "mods": { diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 8652ce7f..f00f774c 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "Import your maps", "subtext": "Drop your zip files here to import your maps" + }, + "sort": { + "name": "Name", + "song-author": "Song Author", + "map-author": "Map Author", + "bpm": "BPM", + "duration": "Duration", + "likes": "Likes", + "date-uploaded": "Date Uploaded" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "Import your playlists", "subtext": "Drop your \".bplist\" or \".json\" files here to import them" + }, + "sort": { + "title": "Title", + "author": "Author", + "number-of-maps": "Number of Maps", + "duration": "Duration", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "Name", - "song-author": "Song Author", - "map-author": "Map Author", - "bpm": "BPM", - "duration": "Duration", - "likes": "Likes", - "date-uploaded": "Date Uploaded" - } - }, - "playlists": { - "sort": { - "title": "Title", - "author": "Author", - "number-of-maps": "Number of Maps", - "duration": "Duration", - "min-notes-per-second": "Min Notes per Second", - "max-notes-per-second": "Max Notes per Second" } }, "mods": { diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index 00d45fd3..5d56f88b 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "Importar tus mapas", "subtext": "Suelta tus archivos zip aquí para importar tus mapas" + }, + "sort": { + "name": "Nombre", + "song-author": "Autor de la canción", + "map-author": "Autor del mapa", + "bpm": "BPM", + "duration": "Duración", + "likes": "Me gusta", + "date-uploaded": "Fecha de subida" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "Importa tus listas de reproducción", "subtext": "Suelta tus archivos \".bplist\" o \".json\" aquí para importarlos" + }, + "sort": { + "title": "Título", + "author": "Autor", + "number-of-maps": "Número de mapas", + "duration": "Duración", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "Nombre", - "song-author": "Autor de la canción", - "map-author": "Autor del mapa", - "bpm": "BPM", - "duration": "Duración", - "likes": "Me gusta", - "date-uploaded": "Fecha de subida" - } - }, - "playlists": { - "sort": { - "title": "Título", - "author": "Autor", - "number-of-maps": "Número de mapas", - "duration": "Duración", - "min-notes-per-second": "Mínimo de notas por segundo", - "max-notes-per-second": "Máximo de notas por segundo" } }, "mods": { diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 7d1f7d66..869017c2 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "Importer vos maps", "subtext": "Déposez vos fichiers zip ici pour importer vos maps" + }, + "sort": { + "name": "Nom", + "song-author": "Auteur de la chanson", + "map-author": "Auteur de la carte", + "bpm": "BPM", + "duration": "Durée", + "likes": "J'aime", + "date-uploaded": "Date de téléchargement" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "Importer vos playlists", "subtext": "Déposez vos fichiers \".bplist\" ou \".json\" ici pour les importer" + }, + "sort": { + "title": "Titre", + "author": "Auteur", + "number-of-maps": "Nombre de cartes", + "duration": "Durée", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "Nom", - "song-author": "Auteur de la chanson", - "map-author": "Auteur de la carte", - "bpm": "BPM", - "duration": "Durée", - "likes": "J'aime", - "date-uploaded": "Date de téléchargement" - } - }, - "playlists": { - "sort": { - "title": "Titre", - "author": "Auteur", - "number-of-maps": "Nombre de cartes", - "duration": "Durée", - "min-notes-per-second": "Minimum de notes par seconde", - "max-notes-per-second": "Maximum de notes par seconde" } }, "mods": { diff --git a/assets/jsons/translations/it.json b/assets/jsons/translations/it.json index 7de34c0c..7d73bae7 100644 --- a/assets/jsons/translations/it.json +++ b/assets/jsons/translations/it.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "Importa le tue mappe", "subtext": "Rilascia qui i tuoi file zip per importare le tue mappe" + }, + "sort": { + "name": "Nome", + "song-author": "Autore della canzone", + "map-author": "Autore della mappa", + "bpm": "BPM", + "duration": "Durata", + "likes": "Mi piace", + "date-uploaded": "Data di caricamento" } }, "playlists": { @@ -102,6 +111,13 @@ "drop-zone": { "text": "Importa le tue playlist", "subtext": "Rilascia qui i file \".bplist\" o \".json\" per importarli" + }, + "sort": { + "title": "Titolo", + "author": "Autore", + "number-of-maps": "Numero di mappe", + "duration": "Durata", + "notes-per-second": "NPS" } } } diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json index 8cc2ecb1..b49a1761 100644 --- a/assets/jsons/translations/ja.json +++ b/assets/jsons/translations/ja.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "マップをインポート", "subtext": "ZIPファイルをここにドロップしてマップをインポート" + }, + "sort": { + "name": "名前", + "song-author": "曲の作者", + "map-author": "地図の作者", + "bpm": "BPM", + "duration": "持続時間", + "likes": "いいね", + "date-uploaded": "アップロード日" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "プレイリストをインポート", "subtext": "\".bplist\" または \".json\" ファイルをここにドロップしてインポート" + }, + "sort": { + "title": "タイトル", + "author": "著者", + "number-of-maps": "地図の数", + "duration": "持続時間", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "名前", - "song-author": "曲の作者", - "map-author": "地図の作者", - "bpm": "BPM", - "duration": "持続時間", - "likes": "いいね", - "date-uploaded": "アップロード日" - } - }, - "playlists": { - "sort": { - "title": "タイトル", - "author": "著者", - "number-of-maps": "地図の数", - "duration": "持続時間", - "min-notes-per-second": "秒あたりの最小ノート数", - "max-notes-per-second": "秒あたりの最大ノート数" } }, "mods": { diff --git a/assets/jsons/translations/ko.json b/assets/jsons/translations/ko.json index e296c2af..2a704a8c 100644 --- a/assets/jsons/translations/ko.json +++ b/assets/jsons/translations/ko.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "맵 가져오기", "subtext": "ZIP 파일을 여기에 드롭하여 맵 가져오기" + }, + "sort": { + "name": "이름", + "song-author": "작곡가", + "map-author": "지도 제작자", + "bpm": "BPM", + "duration": "지속 시간", + "likes": "좋아요", + "date-uploaded": "업로드 날짜" } }, "playlists": { @@ -102,6 +111,13 @@ "drop-zone": { "text": "재생 목록 가져오기", "subtext": "\".bplist\" 또는 \".json\" 파일을 여기에 드롭하여 가져오기" + }, + "sort": { + "title": "제목", + "author": "저자", + "number-of-maps": "지도 수", + "duration": "지속 시간", + "notes-per-second": "NPS" } } } diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json index 83bd88e0..0d724bf5 100644 --- a/assets/jsons/translations/ru.json +++ b/assets/jsons/translations/ru.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "Импортируйте свои карты", "subtext": "Перетащите сюда файлы ZIP, чтобы импортировать свои карты" + }, + "sort": { + "name": "Имя", + "song-author": "Автор песни", + "map-author": "Автор карты", + "bpm": "BPM", + "duration": "Длительность", + "likes": "Лайки", + "date-uploaded": "Дата загрузки" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "Импортируйте ваши плейлисты", "subtext": "Перетащите сюда файлы \".bplist\" или \".json\" для их импорта" + }, + "sort": { + "title": "Заголовок", + "author": "Автор", + "number-of-maps": "Количество карт", + "duration": "Длительность", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "Имя", - "song-author": "Автор песни", - "map-author": "Автор карты", - "bpm": "BPM", - "duration": "Длительность", - "likes": "Лайки", - "date-uploaded": "Дата загрузки" - } - }, - "playlists": { - "sort": { - "title": "Заголовок", - "author": "Автор", - "number-of-maps": "Количество карт", - "duration": "Длительность", - "min-notes-per-second": "Минимальное количество нот в секунду", - "max-notes-per-second": "Максимальное количество нот в секунду" } }, "mods": { diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json index f24b87f6..79c263db 100644 --- a/assets/jsons/translations/zh-tw.json +++ b/assets/jsons/translations/zh-tw.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "導入您的地圖", "subtext": "將ZIP文件拖放到此處以導入您的地圖" + }, + "sort": { + "name": "名字", + "song-author": "歌曲作者", + "map-author": "地圖作者", + "bpm": "BPM", + "duration": "持續時間", + "likes": "喜歡", + "date-uploaded": "上傳日期" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "匯入您的播放列表", "subtext": "將您的 \".bplist\" 或 \".json\" 檔案拖曳到這裡進行匯入" + }, + "sort": { + "title": "標題", + "author": "作者", + "number-of-maps": "地圖數量", + "duration": "持續時間", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "名字", - "song-author": "歌曲作者", - "map-author": "地圖作者", - "bpm": "BPM", - "duration": "持續時間", - "likes": "喜歡", - "date-uploaded": "上傳日期" - } - }, - "playlists": { - "sort": { - "title": "標題", - "author": "作者", - "number-of-maps": "地圖數量", - "duration": "持續時間", - "min-notes-per-second": "每秒最少音符數", - "max-notes-per-second": "每秒最多音符數" } }, "mods": { diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json index 4744fc6c..fb4e5c39 100644 --- a/assets/jsons/translations/zh.json +++ b/assets/jsons/translations/zh.json @@ -91,6 +91,15 @@ "drop-zone": { "text": "导入您的地图", "subtext": "将ZIP文件拖放到此处以导入您的地图" + }, + "sort": { + "name": "名字", + "song-author": "歌曲作者", + "map-author": "地图作者", + "bpm": "BPM", + "duration": "持续时间", + "likes": "喜欢", + "date-uploaded": "上传日期" } }, "playlists": { @@ -102,27 +111,15 @@ "drop-zone": { "text": "导入您的播放列表", "subtext": "将您的 \".bplist\" 或 \".json\" 文件拖放到这里进行导入" + }, + "sort": { + "title": "标题", + "author": "作者", + "number-of-maps": "地图数量", + "duration": "持续时间", + "notes-per-second": "NPS" } } - }, - "sort": { - "name": "名字", - "song-author": "歌曲作者", - "map-author": "地图作者", - "bpm": "BPM", - "duration": "持续时间", - "likes": "喜欢", - "date-uploaded": "上传日期" - } - }, - "playlists": { - "sort": { - "title": "标题", - "author": "作者", - "number-of-maps": "地图数量", - "duration": "持续时间", - "min-notes-per-second": "每秒最少音符数", - "max-notes-per-second": "每秒最多音符数" } }, "mods": { diff --git a/src/renderer/components/maps-playlists-panel/maps-playlists-panel.component.tsx b/src/renderer/components/maps-playlists-panel/maps-playlists-panel.component.tsx index 4b3b7cc4..8c018766 100644 --- a/src/renderer/components/maps-playlists-panel/maps-playlists-panel.component.tsx +++ b/src/renderer/components/maps-playlists-panel/maps-playlists-panel.component.tsx @@ -86,7 +86,7 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) { const [sortOptions, setSortOptions] = useState[]>( () => mapsSorter.getComparatorKeys().map(key => ({ - text: `pages.version-viewer.maps.sort.${key}`, + text: `pages.version-viewer.maps.tabs.maps.sort.${key}`, value: key, })) ); @@ -131,7 +131,7 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) { switch (index) { case MAP_TAB: setSortOptions(() => mapsSorter.getComparatorKeys().map(key => ({ - text: `pages.version-viewer.maps.sort.${key}`, + text: `pages.version-viewer.maps.tabs.maps.sort.${key}`, value: key, }))); setSelectedSort(mapsSorter.getDefaultComparatorKey()); @@ -143,7 +143,7 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) { case PLAYLIST_TAB: setSortOptions(() => playlistsSorter.getComparatorKeys().map(key => ({ - text: `pages.version-viewer.playlists.sort.${key}`, + text: `pages.version-viewer.maps.tabs.playlists.sort.${key}`, value: key, }))); setSelectedSort(playlistsSorter.getDefaultComparatorKey()); @@ -282,9 +282,9 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) { {( tabIndex === 0 ? ( - + ) : ( - + ) )} diff --git a/src/renderer/services/playlists/sorter.service.ts b/src/renderer/services/playlists/sorter.service.ts index f073ecaa..e61c2177 100644 --- a/src/renderer/services/playlists/sorter.service.ts +++ b/src/renderer/services/playlists/sorter.service.ts @@ -24,14 +24,7 @@ export class PlaylistsSorterService { return !playlist2.duration ? Comparison.GREATER : playlist1.duration - playlist2.duration; }, - "min-notes-per-second": (playlist1, playlist2) => { - if (!playlist1.minNps) { - return playlist2.minNps ? Comparison.LESSER : Comparison.EQUAL; - } - - return !playlist2.minNps ? Comparison.GREATER : playlist1.minNps - playlist2.minNps; - }, - "max-notes-per-second": (playlist1, playlist2) => { + "notes-per-second": (playlist1, playlist2) => { if (!playlist1.maxNps) { return playlist2.maxNps ? Comparison.LESSER : Comparison.EQUAL; }