From cb2320ac60ad336c4a7b213a27c06efa9211960c Mon Sep 17 00:00:00 2001 From: mikooomich Date: Tue, 21 Jan 2025 13:12:50 -0500 Subject: [PATCH] app: Refactor strings --- .../ui/component/CreatePlaylistDialog.kt | 4 +- .../ui/screens/settings/AboutScreen.kt | 4 +- .../ui/screens/settings/AppearanceSettings.kt | 26 --- .../ui/screens/settings/BackupAndRestore.kt | 2 +- .../ui/screens/settings/ContentSettings.kt | 3 +- .../ui/screens/settings/LyricsSettings.kt | 52 +++--- .../viewmodels/BackupRestoreViewModel.kt | 2 +- app/src/main/res/values/strings-ot.xml | 128 ++++++++++++++ app/src/main/res/values/strings.xml | 157 +----------------- 9 files changed, 174 insertions(+), 204 deletions(-) create mode 100644 app/src/main/res/values/strings-ot.xml diff --git a/app/src/main/java/com/dd3boh/outertune/ui/component/CreatePlaylistDialog.kt b/app/src/main/java/com/dd3boh/outertune/ui/component/CreatePlaylistDialog.kt index cbdecb756..a38809632 100644 --- a/app/src/main/java/com/dd3boh/outertune/ui/component/CreatePlaylistDialog.kt +++ b/app/src/main/java/com/dd3boh/outertune/ui/component/CreatePlaylistDialog.kt @@ -73,12 +73,12 @@ fun CreatePlaylistDialog( ) { Column { Text( - text = "Sync Playlist", + text = stringResource(R.string.create_sync_playlist), style = MaterialTheme.typography.titleLarge, ) Text( - text = "Note: This allows for syncing with YouTube Music. This is NOT changeable later. You cannot add local songs to synced playlists.", + text = stringResource(R.string.create_sync_playlist_description), style = MaterialTheme.typography.bodySmall, modifier = Modifier.fillMaxWidth(0.7f) ) diff --git a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AboutScreen.kt b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AboutScreen.kt index 4858372b3..14f9b691d 100644 --- a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AboutScreen.kt +++ b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AboutScreen.kt @@ -145,7 +145,7 @@ fun AboutScreen( verticalAlignment = Alignment.Top, ) { Text( - text = "Special Thanks", + text = stringResource(R.string.special_thanks), style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.Bold, modifier = Modifier.padding(top = 8.dp, bottom = 4.dp) @@ -153,7 +153,7 @@ fun AboutScreen( } Text( - text = "Zion Huang for InnerTune", + text = stringResource(R.string.attrib_zhuang), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.secondary ) diff --git a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AppearanceSettings.kt b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AppearanceSettings.kt index 42780c689..5097c7be9 100644 --- a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AppearanceSettings.kt +++ b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/AppearanceSettings.kt @@ -149,32 +149,6 @@ fun AppearanceSettings( } mutableTabs.move(from.index, to.index) } - LaunchedEffect(reorderableState.isAnyItemDragging) { - if (!reorderableState.isAnyItemDragging) { - dragInfo?.let { (from, to) -> -// if (from == to) { -// return@LaunchedEffect -// } - -// mutableTabs.apply { -// clear() -// -// val enabled = decodeTabString(enabledTabs) -// addAll(enabled) -// add(NavigationTab.NULL) -// addAll(NavigationTab.entries.filter { item -> enabled.none { it == item || item == NavigationTab.NULL } }) -// } - } - } - } - - - -// val reorderableState = rememberReorderableLazyListState( -// onMove = { from, to -> -// mutableTabs.move(from.index, to.index) -// } -// ) fun updateTabs() { mutableTabs.apply { diff --git a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/BackupAndRestore.kt b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/BackupAndRestore.kt index 5f4f8ccb0..781fa48b2 100644 --- a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/BackupAndRestore.kt +++ b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/BackupAndRestore.kt @@ -150,7 +150,7 @@ fun BackupAndRestore( ) { item { Text( - text = "Could not import:", + text = stringResource(R.string.m3u_import_song_failed), fontSize = 24.sp, fontWeight = FontWeight.Bold, maxLines = 1, diff --git a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/ContentSettings.kt b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/ContentSettings.kt index 00787975c..e67da1a97 100644 --- a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/ContentSettings.kt +++ b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/ContentSettings.kt @@ -1,5 +1,6 @@ package com.dd3boh.outertune.ui.screens.settings +import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsetsSides @@ -230,7 +231,7 @@ fun ContentSettings( onCheckedChange = onProxyEnabledChange ) - if (proxyEnabled) { + AnimatedVisibility(proxyEnabled) { ListPreference( title = { Text(stringResource(R.string.proxy_type)) }, selectedValue = proxyType, diff --git a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/LyricsSettings.kt b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/LyricsSettings.kt index 1460e102d..d56bdf53d 100644 --- a/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/LyricsSettings.kt +++ b/app/src/main/java/com/dd3boh/outertune/ui/screens/settings/LyricsSettings.kt @@ -37,6 +37,7 @@ import com.dd3boh.outertune.ui.component.CounterDialog import com.dd3boh.outertune.ui.component.EnumListPreference import com.dd3boh.outertune.ui.component.IconButton import com.dd3boh.outertune.ui.component.PreferenceEntry +import com.dd3boh.outertune.ui.component.PreferenceGroupTitle import com.dd3boh.outertune.ui.component.SwitchPreference import com.dd3boh.outertune.ui.utils.backToMain import com.dd3boh.outertune.utils.rememberEnumPreference @@ -86,7 +87,9 @@ fun LyricsSettings( .windowInsetsPadding(LocalPlayerAwareWindowInsets.current) .verticalScroll(rememberScrollState()) ) { - // providers + PreferenceGroupTitle( + title = stringResource(R.string.lrc_src) + ) SwitchPreference( title = { Text(stringResource(R.string.enable_lrclib)) }, icon = { Icon(Icons.Rounded.Lyrics, null) }, @@ -101,21 +104,18 @@ fun LyricsSettings( onCheckedChange = onEnableKugouChange ) - // lyrics position - EnumListPreference( - title = { Text(stringResource(R.string.lyrics_text_position)) }, - icon = { Icon(Icons.Rounded.Lyrics, null) }, - selectedValue = lyricsPosition, - onValueSelected = onLyricsPositionChange, - valueText = { - when (it) { - LyricsPosition.LEFT -> stringResource(R.string.left) - LyricsPosition.CENTER -> stringResource(R.string.center) - LyricsPosition.RIGHT -> stringResource(R.string.right) - } - } + // prioritize local lyric files over all cloud providers + SwitchPreference( + title = { Text(stringResource(R.string.lyrics_prefer_local)) }, + description = stringResource(R.string.lyrics_prefer_local_description), + icon = { Icon(Icons.Rounded.ContentCut, null) }, + checked = preferLocalLyric, + onCheckedChange = onPreferLocalLyric ) + PreferenceGroupTitle( + title = stringResource(R.string.parser) + ) // multiline lyrics SwitchPreference( title = { Text(stringResource(R.string.lyrics_multiline_title)) }, @@ -132,13 +132,23 @@ fun LyricsSettings( checked = lyricTrim, onCheckedChange = onLyricTrimChange ) - // prioritize local lyric files over all cloud providers - SwitchPreference( - title = { Text(stringResource(R.string.lyrics_prefer_local)) }, - description = stringResource(R.string.lyrics_prefer_local_description), - icon = { Icon(Icons.Rounded.ContentCut, null) }, - checked = preferLocalLyric, - onCheckedChange = onPreferLocalLyric + PreferenceGroupTitle( + title = stringResource(R.string.formatting) + ) + + // lyrics position + EnumListPreference( + title = { Text(stringResource(R.string.lyrics_text_position)) }, + icon = { Icon(Icons.Rounded.Lyrics, null) }, + selectedValue = lyricsPosition, + onValueSelected = onLyricsPositionChange, + valueText = { + when (it) { + LyricsPosition.LEFT -> stringResource(R.string.left) + LyricsPosition.CENTER -> stringResource(R.string.center) + LyricsPosition.RIGHT -> stringResource(R.string.right) + } + } ) PreferenceEntry( diff --git a/app/src/main/java/com/dd3boh/outertune/viewmodels/BackupRestoreViewModel.kt b/app/src/main/java/com/dd3boh/outertune/viewmodels/BackupRestoreViewModel.kt index ebd853b9b..0b954e0a1 100644 --- a/app/src/main/java/com/dd3boh/outertune/viewmodels/BackupRestoreViewModel.kt +++ b/app/src/main/java/com/dd3boh/outertune/viewmodels/BackupRestoreViewModel.kt @@ -149,7 +149,7 @@ class BackupRestoreViewModel @Inject constructor( } }.onFailure { reportException(it) - Toast.makeText(context, R.string.m3u_import_failed, Toast.LENGTH_SHORT).show() + Toast.makeText(context, R.string.m3u_import_playlist_failed, Toast.LENGTH_SHORT).show() } if (songs.isEmpty()) { diff --git a/app/src/main/res/values/strings-ot.xml b/app/src/main/res/values/strings-ot.xml new file mode 100644 index 000000000..952104add --- /dev/null +++ b/app/src/main/res/values/strings-ot.xml @@ -0,0 +1,128 @@ + + + + Folders + Library + + + Recent activity + + + Local + Remote + + + + \"%s\" added to queue + New queue + + + Auto playlist + + + Selection mode + Like all + Do you really want to delete the stored lyrics for \"%s\"? + + + Date modified + Date released + Date liked + + + Play count + + + Debug + Logout + + + Player background style + Follow theme + Gradient + Blur + New interface layout + Show liked and downloaded playlists in library + Hide bottom navbar labels + + + Tap to show token + Tap again to copy or edit + This is an ADVANCED login method. As an alternative to the web portal, you may directly enter or update your login token here. For example, this can speed up logging in on multiple devices. Please note that any invalid token formats the app fails to parse will not be accepted + Token + Edit Token + Invalid token. Please ensure it includes the SAPISID cookie. + Automatically sync with your YouTube Music account + Automatically download your liked songs + Wi-Fi only + OFF + ON + Max (beta) + + + Enable offload + Use the offload audio path for audio playback. Disabling this may increase power usage but can be useful if you experience issues with audio playback or post processing + Prevent system killing app + Use a foreground notification to prevent OuterTune from being randomly closed by the system. + Minimum playback duration + The minimum amount of a song that must be played before it is considered \"played\" + + + Lyrics + Read multiline lyrics + Treat all the lines between sync points as one lyric text + Remove spaces around lyrics + Prefer local lyric files + Prioritize resolving local lyric files before using all cloud providers. Turn ths off to prioritize cloud providers + Font size + Lyric sources + Parser + Formatting + + + Enable local media + Disabling will hide local library from the app + Local media + Flatten subfolders + Disable to preserve the file structure as on disk + Restoring OuterTune backups are supported, albeit a possibility of anomalies due to technical limitations + Import a playlist (m3u) + Failed to import playlist + + + Local scanner + Scan automatically + Automatically scan for songs when opening the app. This does not reload metadata of existing songs. + Configure scan locations… + All subdirectories will also be affected + Add new folder + Scan paths + Excluded scan paths + Manual scanner + By default, the scanner will NOT reload any metadata of existing songs unless you specify otherwise above. Depending on the size of your library, it make take a while. + + + Additional scanner settings + Strict file names + When enabled, file names will NOT be ignored. Ex. "Song.ogg" will be a different song from "Song.flac". Scanner sensitivity preference will still apply + Configure scanner sensitivity + Match title + Match title and artists + Match title, artists, albums + Metadata extractor + Use integrated TagLib metadata extractor + Use FFMpeg metadata extractor. Requires external package to be installed + Rescan the entire library and reload all songs\' metadata + Try to link local files\' artists with ones on YouTube Music + + + Could not import: + + + Experimental + Enable developer settings + Reveals additional advanced settings intended for development use + Translation Models + Clear translation models + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8ab5f1348..cfa98156c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,5 @@ - - + Home @@ -118,7 +117,6 @@ Song count Length Play time - Play count Custom order @@ -207,9 +205,6 @@ No network connection Timeout Unknown error - On error - Pause - Wait to reconnect"> Like @@ -224,8 +219,7 @@ All songs - - Search: + Searched songs Music Player @@ -241,9 +235,6 @@ Follow system Pure black Customize navigation tabs - Tab arrangement - Arrange tabs - Layout Player Player text alignment Lyrics text position @@ -263,27 +254,22 @@ Content Login Not logged in - Localization Default content language Default content country System default - Proxy Enable proxy Proxy type Proxy URL Restart to take effect Player and audio - Interface Audio quality Auto High Low - Audio Queue Persistent queue - - Restore previous open queue(s) when the app starts + Restore your last queue when the app starts Auto load more songs Automatically add more songs when the end of the queue is reached, if possible Skip silence @@ -330,149 +316,20 @@ Backup created successfully Couldn\'t create backup Failed to restore backup - + Discord Integration - OuterTune uses the KizzyRPC library to set your Discord account\'s status. This involves using the Discord Gateway connection, which may be considered a violation of Discord\'s TOS. However, there are no known cases of user accounts being suspended for this reason. Use at your own risk. OuterTune will only extract your token, and everything else is stored locally. + InnerTune uses the KizzyRPC library to set your Discord account\'s status. This involves using the Discord Gateway connection, which may be considered a violation of Discord\'s TOS. However, there are no known cases of user accounts being suspended for this reason. Use at your own risk.\n\nInnerTune will only extract your token, and everything else is stored locally. Dismiss Options Preview Login failed - Enable Rich Presense + Logout + Enable Rich Presence About App version New version available - - - - - - - - Folders - Library - - - Recent activity - - - Local - Remote - - - - - \"%s\" added to queue - New queue - - - Auto playlist - - - Selection mode - Like all - Do you really want to delete the stored lyrics for \"%s\"? - - - Date modified - Date released - Date liked - - - Play count - - - Debug - Logout - - - Player background style - Follow theme - Gradient - Blur - New interface layout - Show liked and downloaded playlists in library"> - Hide bottom navbar labels - - - - Tap to show token - Tap again to copy or edit - This is an ADVANCED login method. As an alternative to the web portal, you may directly enter or update your login token here. For example, this can speed up logging in on multiple devices. Please note that any invalid token formats the app fails to parse will not be accepted - Token - Edit Token - Invalid token. Please ensure it includes the SAPISID cookie. - Automatically sync with your YouTube Music account - Automatically download your liked songs - Wi-Fi only - - - Enable offload - Use the offload audio path for audio playback. Disabling this may increase power usage but can be useful if you experience issues with audio playback or post processing - Prevent system killing app - Use a foreground notification to prevent OuterTune from being randomly closed by the system. - Minimum playback duration - The minimum amount of a song that must be played before it is considered \"played\" - - - Lyrics - Read multiline lyrics - Treat all the lines between sync points as one lyric text - Remove spaces around lyrics - Prefer local lyric files - Prioritize resolving local lyric files before using all cloud providers. Turn ths off to prioritize cloud providers - Font size - - - Enable local media - Disabling will hide local library from the app - Local media - Flatten subfolders - Disable to preserve the file structure as on disk - - Restoring OuterTune backups are supported, albeit a possibility of anomalies due to technical limitations - Import a playlist (m3u) - Failed to import playlist - - - Local scanner - Scan automatically - Automatically scan for songs when opening the app. This does not reload metadata of existing songs. - - Configure scan locations… - All subdirectories will also be affected - Add new folder - Scan paths - Excluded scan paths - - Manual scanner - By default, the scanner will NOT reload any metadata of existing songs unless you specify otherwise above. Depending on the size of your library, it make take a while. - - - Additional scanner settings - Strict file names - When enabled, file names will NOT be ignored. Ex. "Song.ogg" will be a different song from "Song.flac". Scanner sensitivity preference will still apply - Configure scanner sensitivity - Match title - Match title and artists - Match title, artists, albums - - Metadata extractor - Use integrated TagLib metadata extractor - Use FFMpeg metadata extractor. Requires external package to be installed - - - Rescan the entire library and reload all songs\' metadata - Try to link local files\' artists with ones on YouTube Music - - - Experimental - Enable developer settings - Reveals additional advanced settings intended for development use Translation Models Clear translation models - OFF - ON - Max (beta)