Skip to content
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

Regional languages support #336

Closed
wants to merge 5 commits into from
Closed

Conversation

sk-juroot
Copy link
Contributor

Description

Reworked CustomActivity.setLocale() to internally handle regional and non-regional language codes on various system versions.

Related issues

Additional context

This code contains hardcoded check for Portuguese language (as the only regional-coded language in this project right now), since various Android devices may report this language as non-regional, causing falling back to English even when proper language asset is present.

setting locale before loading main settings view resources
explicitly defined system language selection on default language choice, added code for better compatibility with APIs < 24
little refactor of locale code, CustomActivity.setLocale now parses language for itself, even for system provided language code
@cgeo-ci-bot
Copy link
Collaborator

Can one of the core team members give me the the permission to test this?

@sk-juroot sk-juroot changed the title Issue 329 Regional languages support Jan 2, 2022
@bekuno
Copy link
Member

bekuno commented Jan 2, 2022

Ok to test

@Lineflyer
Copy link
Member

@sk-juroot Your local branch also contains the commits already merged as part of #332. Can you rebase / recreate this PR as on top fixes based on current master?

@sk-juroot sk-juroot closed this Jan 3, 2022
@sk-juroot
Copy link
Contributor Author

Sure, will open another PR from different branch to merge this change

@sk-juroot sk-juroot deleted the issue-329 branch January 3, 2022 20:01
Comment on lines +271 to +273
if (loc[0].equals("pt")) {
// nasty hotfix for Portuguese language selected without regional code
locale = new Locale(loc[0], loc[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it the way around - rename the language pt_PT to pt.
I created Issue #342 for it.
After that these lines are not more necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants