-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 language selector to change the app language #2921
Conversation
1) now, on « content language » change, it will also change the app language 2) added Esperanto to the list of language in content language
I found an exception (#2940), but it's not related to my PR, it's related to the formatter and %1$s not in the good order and arabic alphabet. |
I changed the way time is displayed, it now use NewPipe's language (the new selector), previously it was only systems's language. |
I just fixed Indonesian that wasn't possible to select by renaming values-id to values-in, but also wasn't possible to use with device language. Indonesian was 99% translated but unusable. |
This is a hardly reproduceable bug that I hopefully fixed. After a long time of watching videos, you could have your system language shown in playback parameters dialog. Calling changeAppLanguage(getAppLocale(…),…) onCreate will most certainly fix this bug
@abusarimhindi APK: apk-debug For anyone else wondering, this is a TEST version: there might be some problems, because I was based on dev branch in extractor, and I switched to master branch of extractor (the only one that includes the fix for decryption bug). That's also why I didn't commit these changes. I manually updated extractor version so that YouTube works again, and remove the urdu string, took the one from weblate. |
This is 0.18.1 because I'm based on debug build, which is still on 0.18.1. But I think you have the wrong version, you have to take the app-debug that I gave in my last comment, or just use this link https://github.com/TeamNewPipe/NewPipe/files/4108063/app-debug.zip |
Sorry, It is Ok. Firstly I downloaded the old file, now updated. Thanks again. |
see TeamNewPipe#2921 (comment) It will add Esperanto, add bengali, update vietnamese pretty time is the library used in the home page: … days ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good so far. Just some minor comments.
Is it necessary to call changeAppLanguage()
in all onCreate
and onResume
methods or can we just do it in App.java in? If not, it might be good to add a new method and call it instead of changeAppLanguage()
with the same parameters again and again to increase maintainability.
public static void assureCorrectAppLanguage() {
changeAppLanguage(getAppLocale(getApplicationContext()), getResources());
}
I can't do that, I can't have context and resources from a static context. public static void assureCorrectAppLanguage(Context c) {
changeAppLanguage(getAppLocale(c), c.getResources());
} and then, in mainactivity and other activites needing it:
Yesn't sir! If you put in onCreate and onResume of mainActivity, it will work for about 95%. (And putting it in App.java does nothing) I'll say why I put for the other files:
It's kinda like the |
My bad. This happens when you write reviews during lectures :D |
Code looks go so far. I'll test it as soon as possible |
renamed NewPipe's language into App language, and same for all the concerning thing (keys, comments…) we now call assureCorrectAppLanguage(CONTEXT) in activities needing it instead of changeAppLanguage(getAppLocale(CONTEXT), RESOURCES) changeAppLanguage becomes private.
Just one thing you should know
No problem |
Changed android.R.string.ok, which is "OK", into R.string.finish, which is also OK, but from our strings Then for a small amount of languages that don't have Android translation, it will show the good string.
I merged weblate into dev. Could you take a look at the conflicts? I am short on time until I finished my exams. Thanks :) |
Done. Actually, the only conflict shown on Github was the indonesian file which have been renamed, but while merging with git I had no problem. I think the PR is finally fully ready. |
Thanks. One small thing. Can you please integrate this setting into the mechanism which displays a toast that language changes require an app restart? NewPipe/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java Lines 135 to 140 in c5e6bb5
|
I forgot to change the key here when I renamed it
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes #2794, fixes #2162, fixes #2887, fixes #1215, fixes #1130, fixes #2848, fixes #578, fix r/NewPipe : Any way to change the app language? & r/NewPipe : how to change app language ?
Explaination :
Before, NewPipe's language was phone's language. Now, it's the language selected in Settings -> Content -> App language, and by default, it stays system default language.
Thus, you can force an app language (eg. English for developing / debugging : take a screenshot in English) or use non-available system language (Esperanto isn't translated for Android) or simply just set the language you want without changing phone / system language.
APK: 2020-01-27_language-selector#2921_APK.zip