Skip to content

Commit

Permalink
app: Refactor strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mikooomich authored and reocat committed Jan 23, 2025
1 parent 345d52b commit 63138f6
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ 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)
)
}

Text(
text = "Zion Huang for InnerTune",
text = stringResource(R.string.attrib_zhuang),
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.secondary
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -230,7 +231,7 @@ fun ContentSettings(
onCheckedChange = onProxyEnabledChange
)

if (proxyEnabled) {
AnimatedVisibility(proxyEnabled) {
ListPreference(
title = { Text(stringResource(R.string.proxy_type)) },
selectedValue = proxyType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) },
Expand All @@ -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)) },
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru-rRU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
<string name="dev_settings_title">Включить настройки для разработчиков</string>
<string name="import_innertune_tooltip">Восстановление резервных копий OuterTune поддерживается, однако возможны проблемы в связи с техническими ограничениями</string>
<string name="import_m3u">Импортировать плейлист (m3u)</string>
<string name="m3u_import_failed">Не удалось импортировать плейлист</string>
<string name="m3u_import_playlist_failed">Не удалось импортировать плейлист</string>
<string name="auto_scanner_title">Сканировать автоматически</string>
<string name="scanner_sensitivity_title">Настройка чувствительности сканера</string>
<string name="folders">Папки</string>
Expand Down
58 changes: 34 additions & 24 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<!--InnerTune strings-->
<!--InnerTune strings-->
<!--!!! If you are modifying OuterTune strings, they are at the bottom with the same headings !!!-->

<!-- Bottom navigation -->
Expand Down Expand Up @@ -224,7 +224,7 @@

<!-- Queue Title -->
<string name="queue_all_songs">All songs</string>
<!-- OuterTune: Keep this one below as is:-->
<!-- OuterTune: Keep this one below as is:-->
<string name="queue_searched_songs">Search: </string>

<!-- Notification name -->
Expand Down Expand Up @@ -282,7 +282,7 @@
<string name="audio">Audio</string>
<string name="queue">Queue</string>
<string name="persistent_queue">Persistent queue</string>
<!-- OuterTune: Keep this one below as is-->
<!-- OuterTune: Keep this one below as is-->
<string name="persistent_queue_desc">Restore previous open queue(s) when the app starts</string>
<string name="auto_load_more">Auto load more songs</string>
<string name="auto_load_more_desc">Automatically add more songs when the end of the queue is reached, if possible</string>
Expand Down Expand Up @@ -330,14 +330,15 @@
<string name="backup_create_success">Backup created successfully</string>
<string name="backup_create_failed">Couldn\'t create backup</string>
<string name="restore_failed">Failed to restore backup</string>

<string name="discord_integration">Discord Integration</string>
<string name="discord_information">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.</string>
<string name="enable_discord_rpc">Enable Rich Presense</string>

<string name="dismiss">Dismiss</string>
<string name="options">Options</string>
<string name="preview">Preview</string>
<string name="login_failed">Login failed</string>
<string name="enable_discord_rpc">Enable Rich Presense</string>

<string name="about">About</string>
<string name="app_version">App version</string>
Expand All @@ -347,46 +348,52 @@



<!--OuterTune strings below-->
<!--OuterTune strings below-->

<!-- Bottom navigation -->
<!-- Bottom navigation -->
<string name="folders">Folders</string>
<string name="library">Library</string>

<!-- Home -->
<!-- Home -->
<string name="recent_activity">Recent activity</string>

<!-- History screen-->
<!-- History screen-->
<string name="local_history">Local</string>
<string name="remote_history">Remote</string>

<!-- Library screens -->
<!-- Library screens -->

<!-- Queue -->
<!-- Queue -->
<string name="song_added_to_queue">\"%s\" added to queue</string>
<string name="create_queue">New queue</string>

<!-- Playlist -->
<!-- Playlist -->
<string name="auto_playlist">Auto playlist</string>

<!-- Menu -->
<!-- Menu -->
<string name="select">Selection mode</string>
<string name="like_all">Like all</string>
<string name="delete_lyric_confirm">Do you really want to delete the stored lyrics for \"%s\"?</string>

<!-- Sort menu -->
<!-- Sort menu -->
<string name="sort_by_date_modified">Date modified</string>
<string name="sort_by_date_released">Date released</string>
<string name="sort_by_like_date">Date liked</string>

<!-- Dialog -->
<!-- Dialog -->
<string name="create_sync_playlist">Sync Playlist</string>
<string name="create_sync_playlist_description">Note: This allows for syncing with YouTube Music. This is NOT changeable later. You cannot add local songs to synced playlists.</string>
<string name="play_count">Play count</string>

<!-- Settings -->
<!-- Settings -->
<string name="settings_debug">Debug</string>
<string name="logout">Logout</string>

<!-- Appearance settings -->
<!-- About screen -->
<string name="attrib_zhuang">Zion Huang for InnerTune</string>
<string name="special_thanks">Special thanks</string>

<!-- Appearance settings -->
<string name="player_background_style">Player background style</string>
<string name="player_background_default">Follow theme</string>
<string name="player_background_gradient">Gradient</string>
Expand Down Expand Up @@ -415,7 +422,7 @@
<string name="min_playback_duration">Minimum playback duration</string>
<string name="min_playback_duration_description">The minimum amount of a song that must be played before it is considered \"played\"</string>

<!--Lyrics settings -->
<!--Lyrics settings -->
<string name="lyrics_settings_title">Lyrics</string>
<string name="lyrics_multiline_title">Read multiline lyrics</string>
<string name="lyrics_multiline_description">Treat all the lines between sync points as one lyric text</string>
Expand All @@ -424,7 +431,7 @@
<string name="lyrics_prefer_local_description">Prioritize resolving local lyric files before using all cloud providers. Turn ths off to prioritize cloud providers</string>
<string name="lyrics_font_Size">Font size</string>

<!-- Local player settings -->
<!-- Local player settings -->
<string name="local_library_enable_title">Enable local media</string>
<string name="local_library_enable_description">Disabling will hide local library from the app</string>
<string name="local_player_settings_title">Local media</string>
Expand All @@ -433,9 +440,9 @@

<string name="import_innertune_tooltip">Restoring OuterTune backups are supported, albeit a possibility of anomalies due to technical limitations</string>
<string name="import_m3u">Import a playlist (m3u)</string>
<string name="m3u_import_failed">Failed to import playlist</string>
<string name="m3u_import_playlist_failed">Failed to import playlist</string>

<!-- Scanner settings -->
<!-- Scanner settings -->
<string name="local_scanner_title">Local scanner</string>
<string name="auto_scanner_title">Scan automatically</string>
<string name="auto_scanner_description">Automatically scan for songs when opening the app. This does not reload metadata of existing songs.</string>
Expand All @@ -449,7 +456,7 @@
<string name="manual_scanner_title">Manual scanner</string>
<string name="scanner_warning">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.</string>

<!-- Scanner parameter settings-->
<!-- Scanner parameter settings-->
<string name="scanner_settings_title">Additional scanner settings</string>
<string name="scanner_strict_file_name_title">Strict file names</string>
<string name="scanner_strict_file_name_description">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</string>
Expand All @@ -466,7 +473,10 @@
<string name="scanner_variant_rescan">Rescan the entire library and reload all songs\' metadata</string>
<string name="scanner_online_artist_linking">Try to link local files\' artists with ones on YouTube Music</string>

<!--experimental settings-->
<!-- Backup and restore settings -->
<string name="m3u_import_song_failed">Could not import:</string>

<!-- Experimental settings -->
<string name="experimental_settings_title">Experimental</string>
<string name="dev_settings_title">Enable developer settings</string>
<string name="dev_settings_description">Reveals additional advanced settings intended for development use</string>
Expand All @@ -475,4 +485,4 @@
<string name="off">OFF</string>
<string name="on">ON</string>
<string name="audio_quality_max">Max (beta)</string>
</resources>
</resources>

0 comments on commit 63138f6

Please sign in to comment.