vfsfitvnm / ViMusic

An Android application for streaming music from YouTube Music.
GNU General Public License v3.0
9.11k stars 894 forks source link

Lyrics transliteration or translation #274

Open jingxingoriginal opened 2 years ago

jingxingoriginal commented 2 years ago

Feature description

The lyrics feature is just awesome. I am amazed by the synchronicity but, It would be better to add translation and transliteration

Why do you want this feature?

A lot of Chinese lyrics are in Chinese letter. I can't read.

Additional information

No response

vfsfitvnm commented 2 years ago

I just discovered there's a Transliterator class, I'll see what I can do

vfsfitvnm commented 2 years ago

First things first: I won't add a translation feature.

Regarding the transliteration, there are a couple of challenges.

Additional resources:

https://www.avajava.com/tutorials/lessons/what-are-the-system-transliterators-available-with-icu4j.html

val transliteratedLyrics = remember(lyrics) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
        Transliterator.getInstance("Any-Latin").transliterate(lyrics)
    } else {
        lyrics
    }
}
yephny commented 2 years ago

If this is going to be implemented, I'd rather have a "preferred script/alphabet" option in settings, with the option to keep the lyrics as they are no matter the language.

RikisuT commented 1 year ago

Found this used in spicetify's lyrics-plus custom app that was customized so that it can translate Japanese and Korean to Romaji here. The custom app also included another synced lyrics provider called Netease.