-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zh_TW #202
Add zh_TW #202
Conversation
Fails to build: |
It seems like the Traditional Chinese translation cannot load, could you fix that? -2022-11-12-11-33-50.mp4 |
I don't know how to fix this bug, but now I can go into the application and skip the language setting and it will display normally, so the problem should be in the language code in |
cloudstream/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt Line 79 in 3fc63a2
The language code should be same as values-* !!! |
cloudstream/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt Line 79 in 0a8cb1d
cloudstream/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt Line 79 in 809693e
Tried it, doesn't work |
I found the problem, because ISO 639-1 codes only have zh code for Chinese, so it's not possible to add another Chinese language |
You can try to use a code of ISO 639-1 codes that isn't used |
Java Locale has Traditional Chinese but that cannot be instantiated given only a language code. I think creating an exception hashmap and just manually mapping the locales there would be the least messy solution: Right below appLanguages: /**
* Not all languages can be fetched from locale with a code.
* This map allows sidestepping the default Locale(languageCode)
* when setting the app language.
**/
val appLanguageExceptions = hashMapOf(
"zh-Hant-TW" to Locale.TRADITIONAL_CHINESE
) and in https://github.com/recloudstream/cloudstream/blob/master/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt#L113 you can add the exception like this: val locale = appLanguageExceptions[languageCode] ?: Locale(languageCode) |
The language can now be switched normally, but there is still a problem with the part where the language selection is displayed. |
What do you mean? |
Like this Record_2022-11-13-17-27-47.mp4 |
Weird, I'll get to investigating soon |
Sorry for the wait 😔 |
Add Traditional Chinese (Taiwan)