Skip to content

Commit

Permalink
Update languages
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrave-dev committed Aug 7, 2024
1 parent 3c4b529 commit 82b5661
Show file tree
Hide file tree
Showing 21 changed files with 358 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.cxx
local.properties
/app/release/
crowdin.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div align="center">
<img src="https://raw.githubusercontent.com/maxrave-dev/SimpMusic/dev/fastlane/metadata/android/en-US/images/featureGraphic.png">
<img src="https://raw.githubusercontent.com/maxrave-dev/SimpMusic/jetpack_compose/fastlane/metadata/android/en-US/images/featureGraphic.png">
<h1>SimpMusic</h1>A FOSS YouTube Music client for Android with many features from<br>Spotify, Musixmatch, SponsorBlock, ReturnYouTubeDislike<br>
<br>
<a href="https://github.com/maxrave-dev/SimpMusic/releases"><img src="https://img.shields.io/github/v/release/maxrave-dev/SimpMusic"></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import androidx.fragment.app.activityViewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.media3.common.MediaItem
import androidx.media3.common.util.UnstableApi
import androidx.media3.exoplayer.offline.DownloadRequest
import androidx.media3.exoplayer.offline.DownloadService
Expand Down Expand Up @@ -70,7 +69,6 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChangedBy
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import java.time.LocalDateTime
Expand Down Expand Up @@ -644,16 +642,15 @@ class AlbumFragment : Fragment() {
val job2 =
launch {
combine(
sharedViewModel.simpleMediaServiceHandler?.nowPlaying
?: flowOf<MediaItem?>(
null,
),
sharedViewModel.isPlaying,
sharedViewModel.nowPlayingState.distinctUntilChangedBy {
it?.songEntity?.videoId
},
sharedViewModel.controllerState,
) { nowPlaying, isPlaying ->
Pair(nowPlaying, isPlaying)
}.collect {
if (it.first != null && it.second) {
songsAdapter.setNowPlaying(it.first!!.mediaId)
if (it.first != null && it.second.isPlaying) {
songsAdapter.setNowPlaying(it.first?.songEntity?.videoId)
} else {
songsAdapter.setNowPlaying(null)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import androidx.fragment.app.viewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.media3.common.MediaItem
import androidx.media3.common.util.UnstableApi
import androidx.navigation.fragment.findNavController
import androidx.palette.graphics.Palette
Expand Down Expand Up @@ -66,7 +65,9 @@ import com.maxrave.simpmusic.viewModel.SharedViewModel
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.distinctUntilChangedBy
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import java.time.LocalDateTime
import kotlin.math.abs
Expand Down Expand Up @@ -684,13 +685,15 @@ class ArtistFragment : Fragment() {
val job2 =
launch {
combine(
sharedViewModel.simpleMediaServiceHandler?.nowPlaying ?: flowOf<MediaItem?>(null),
sharedViewModel.isPlaying,
sharedViewModel.nowPlayingState.distinctUntilChangedBy {
it?.songEntity?.videoId
},
sharedViewModel.controllerState.map { it.isPlaying }.distinctUntilChanged(),
) { nowPlaying, isPlaying ->
Pair(nowPlaying, isPlaying)
}.collect {
if (it.first != null && it.second) {
popularAdapter.setNowPlaying(it.first!!.mediaId)
popularAdapter.setNowPlaying(it.first?.songEntity?.videoId)
} else {
popularAdapter.setNowPlaying(null)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.fragment.app.activityViewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.media3.common.MediaItem
import androidx.media3.common.util.UnstableApi
import androidx.media3.exoplayer.offline.DownloadRequest
import androidx.media3.exoplayer.offline.DownloadService
Expand Down Expand Up @@ -65,7 +64,9 @@ import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.distinctUntilChangedBy
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import java.time.LocalDateTime
Expand Down Expand Up @@ -941,16 +942,15 @@ class PlaylistFragment : Fragment() {
val job2 =
launch {
combine(
sharedViewModel.simpleMediaServiceHandler?.nowPlaying
?: flowOf<MediaItem?>(
null,
),
sharedViewModel.isPlaying,
sharedViewModel.nowPlayingState.distinctUntilChangedBy {
it?.songEntity?.videoId
},
sharedViewModel.controllerState.map { it.isPlaying }.distinctUntilChanged(),
) { nowPlaying, isPlaying ->
Pair(nowPlaying, isPlaying)
}.collect {
if (it.first != null && it.second) {
playlistItemAdapter.setNowPlaying(it.first!!.mediaId)
playlistItemAdapter.setNowPlaying(it.first?.songEntity?.videoId)
} else {
playlistItemAdapter.setNowPlaying(null)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ import com.skydoves.landscapist.palette.rememberPaletteState
import com.skydoves.landscapist.placeholder.placeholder.PlaceholderPlugin
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapLatest
import java.time.format.DateTimeFormatter

Expand Down Expand Up @@ -193,7 +194,7 @@ fun PlaylistScreen(
val playingTrack by sharedViewModel.nowPlayingState.mapLatest {
it?.mediaItem
}.collectAsState(initial = null)
val isPlaying by sharedViewModel.isPlaying.collectAsState()
val isPlaying by sharedViewModel.controllerState.map { it.isPlaying }.collectAsState(initial = false)
val suggestedTracks by viewModel.listSuggestions.collectAsState()
val suggestionsLoading by viewModel.loading.collectAsState()
var showSyncAlertDialog by rememberSaveable { mutableStateOf(false) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ constructor(

var gradientDrawable: MutableLiveData<GradientDrawable> = MutableLiveData()

var isPlaying = MutableStateFlow<Boolean>(false)

var _lyrics = MutableStateFlow<Resource<Lyrics>?>(null)

// val lyrics: LiveData<Resource<Lyrics>> = _lyrics
Expand Down Expand Up @@ -1157,7 +1155,6 @@ constructor(
}

fun stopPlayer() {
isPlaying.value = false
onUIEvent(UIEvent.Stop)
}

Expand Down
21 changes: 20 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,23 @@
<string name="hour_s_ago">منذ %1$d ساعة</string>
<string name="no_notification">لا إشعارات</string>
<string name="created_at">تم الانشاء في %1$s</string>
</resources>
<string name="unknown">Unknown</string>
<string name="repeat_one">Repeat One</string>
<string name="repeat_all">Repeat All</string>
<string name="repeat_off">Repeat Off</string>
<string name="youtube_transcript">YouTube Transcript</string>
<string name="user_interface">Interface</string>
<string name="translucent_bottom_navigation_bar">Translucent bottom navigation bar</string>
<string name="you_can_see_the_content_below_the_bottom_bar">You can see the content below the bottom bar</string>
<string name="donation">If you love my work, give me a coffee</string>
<string name="relax">Relax</string>
<string name="sleep">Sleep</string>
<string name="energize">Energize</string>
<string name="sad">Sad</string>
<string name="romance">Romance</string>
<string name="feel_good">Feel Good</string>
<string name="workout">Workout</string>
<string name="party">Party</string>
<string name="commute">Commute</string>
<string name="focus">Focus</string>
</resources>
21 changes: 20 additions & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,23 @@
<string name="hour_s_ago">Vor %1$d Stunden</string>
<string name="no_notification">Keine Benachrichtigung</string>
<string name="created_at">Erstellt am: %1$s</string>
</resources>
<string name="unknown">Unbekannt</string>
<string name="repeat_one">Einzelwiederholung</string>
<string name="repeat_all">Alle wiederholen</string>
<string name="repeat_off">Wiederholen aus</string>
<string name="youtube_transcript">YouTube-Transkription</string>
<string name="user_interface">Oberfläche</string>
<string name="translucent_bottom_navigation_bar">Durchsichtige untere Navigationsleiste</string>
<string name="you_can_see_the_content_below_the_bottom_bar">Du kannst den Inhalt unter der Navigationsleiste sehen</string>
<string name="donation">Wenn du meine Arbeit magst, fühl dich frei mir einen Kaffee zu spendieren</string>
<string name="relax">Entspannen</string>
<string name="sleep">Schlafen</string>
<string name="energize">Energize</string>
<string name="sad">Traurig</string>
<string name="romance">Romanze</string>
<string name="feel_good">Feel Good</string>
<string name="workout">Workout</string>
<string name="party">Party</string>
<string name="commute">Pendeln</string>
<string name="focus">Fokussieren</string>
</resources>
16 changes: 8 additions & 8 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@
<string name="you_can_see_the_content_below_the_bottom_bar">Puedes ver el contenido debajo de la barra inferior</string>
<string name="donation">Si te gusta mi trabajo, dame un café</string>
<string name="relax">Relax</string>
<string name="sleep">Dormir</string>
<string name="energize">Energía</string>
<string name="sleep">Para dormir</string>
<string name="energize">Enérgica</string>
<string name="sad">Triste</string>
<string name="romance">Amor</string>
<string name="feel_good">Siéntete bien</string>
<string name="workout">Entrenamiento</string>
<string name="romance">Romántica</string>
<string name="feel_good">Buenas vibras</string>
<string name="workout">Para entrenar</string>
<string name="party">Fiesta</string>
<string name="commute">Desplazamientos diarios</string>
<string name="focus">Concentración</string>
</resources>
<string name="commute">Viajes</string>
<string name="focus">Para concentrarte</string>
</resources>
59 changes: 56 additions & 3 deletions app/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<string name="preview">Näyte</string>
<string name="music_off_topic">Musiikki off-topic</string>
<string name="poi_highlight">POI-nosto</string>
<string name="filler">Täyte</string>
<string name="filler">Filter</string>
<string name="sponsorBlock">SponsorBlock</string>
<string name="enable_sponsor_block">Ota SponsorBlock käyttöön</string>
<string name="categories_sponsor_block">Segmenttien ohitus</string>
Expand Down Expand Up @@ -296,5 +296,58 @@
<string name="signed_in">Kirjautuneena</string>
<string name="guest">Vieras</string>
<string name="log_out_warning">Kirjaudu ulos kaikista tileistä?</string>
<string name="play_next">Pelaa seuraavaksi</string>
</resources>
<string name="play_next">Toista seuraavaksi</string>
<string name="codec">Codec</string>
<string name="plays">Play/View Count</string>
<string name="like_and_dislike">%1$d like(s), %2$d dislike(s)</string>
<string name="published_at">Published at %1$s</string>
<string name="less">Less</string>
<string name="spotify">Spotify</string>
<string name="log_in_to_spotify">Log in to Spotify</string>
<string name="intro_login_to_spotify">Log in for Spotify Lyrics, Canvas and more</string>
<string name="enable_spotify_lyrics">Enable Spotify Lyrics</string>
<string name="spotify_lyrícs_info">More lyrics without translation</string>
<string name="enable_canvas">Enable Canvas</string>
<string name="canvas_info">Show Spotify Canvas in SimpMusic</string>
<string name="spotify_lyrics_provider">Lyrics provided by Spotify</string>
<string name="offline_mode">Offline mode</string>
<string name="added_to_youtube_liked">Added to YouTube Liked</string>
<string name="removed_from_youtube_liked">Removed from YouTube Liked</string>
<string name="home_limit">Fetch home data limit</string>
<string name="no_album">No album</string>
<string name="app_widget_description">Player widget</string>
<string name="guide_miniplayer_content">Swipe to show skip and close button</string>
<string name="guide_suggest_content">Show suggested songs by AI based on your playlist</string>
<string name="guide_liked_title">Add to YouTube Liked Playlist</string>
<string name="log_out_from_spotify">Log out from Spotify</string>
<string name="delete">Delete</string>
<string name="top_videos">Top videos</string>
<string name="trending">Trending</string>
<string name="new_singles">New singles</string>
<string name="new_albums">New albums</string>
<string name="notification">Notification</string>
<string name="month_s_ago">%1$d month(s) ago</string>
<string name="day_s_ago">%1$d day(s) ago</string>
<string name="hour_s_ago">%1$d hour(s) ago</string>
<string name="no_notification">No notification</string>
<string name="created_at">Created at %1$s</string>
<string name="unknown">Unknown</string>
<string name="repeat_one">Repeat One</string>
<string name="repeat_all">Repeat All</string>
<string name="repeat_off">Repeat Off</string>
<string name="youtube_transcript">YouTube Transcript</string>
<string name="user_interface">Interface</string>
<string name="translucent_bottom_navigation_bar">Translucent bottom navigation bar</string>
<string name="you_can_see_the_content_below_the_bottom_bar">You can see the content below the bottom bar</string>
<string name="donation">If you love my work, give me a coffee</string>
<string name="relax">Relax</string>
<string name="sleep">Sleep</string>
<string name="energize">Energize</string>
<string name="sad">Sad</string>
<string name="romance">Romance</string>
<string name="feel_good">Feel Good</string>
<string name="workout">Workout</string>
<string name="party">Party</string>
<string name="commute">Commute</string>
<string name="focus">Focus</string>
</resources>
Loading

0 comments on commit 82b5661

Please sign in to comment.