Skip to content

Conversation

philet
Copy link

@philet philet commented Jul 19, 2023

Solves #1693

@philet philet force-pushed the add-app-language-getters branch from 604ec65 to c1cb2d4 Compare July 19, 2023 12:38
@dallastjames dallastjames added the type: feature request A new feature, enhancement, or improvement label Jul 28, 2023
@dallastjames dallastjames added the pr review requested Adds PR to internal issue tracker for team review label Aug 7, 2023
@jcesarmobile
Copy link
Member

I've addressed the changes requested by Mike and added two buttons on the test app for testing
ionic-team/capacitor-testapp#628

But I've noticed that getAppLanguageTag() is also returning a 2 language code on iOS instead of the documented "IETF BCP 47 language tag".
Bundle.main.preferredLocalizations.first will return a matching code on CFBundleLocalizations if there is one, which is usually a 2 letter code, or if there isn't one that matches, then it will return the CFBundleDevelopmentRegion, which is a 2 or 3 letter ISO code. So I don't think the getAppLanguageTag method is needed, and also, I don't think the getAppLanguageCode should return a 2 letter code as it could also be a 3 letter ISO code.
I think it should just be getAppLanguage() and return the whole value of Bundle.main.preferredLocalizations.first

Copy link
Contributor

@IT-MikeS IT-MikeS left a comment

Choose a reason for hiding this comment

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

Please see jcesarmobile's comment above.

@ThatOneCalculator
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr review requested Adds PR to internal issue tracker for team review type: feature request A new feature, enhancement, or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants