Skip to content

fix(geolocation): perm handling around wheninuse vs always #521

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

Open
wants to merge 16 commits into
base: feat/plugin-tools-updates
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(localize): support for language codes with 3 characters (#520)
  • Loading branch information
kmahelona authored Jul 12, 2023
commit 6d67da3ac10cfa81f0962d97ec3a7d86ba3c8509
6 changes: 5 additions & 1 deletion packages/localize/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export function androidLaunchEventLocalizationHandler() {
}

export function overrideLocale(locale: string): boolean {
ApplicationSettings.setString('__app__language__', locale.substring(0, 2));
let language_code = locale.substring(0, 2);
if (locale.indexOf('-') < 0 && locale.length == 3) {
language_code = locale;
}
ApplicationSettings.setString('__app__language__', language_code);
return true;
}
9 changes: 7 additions & 2 deletions packages/localize/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export function androidLaunchEventLocalizationHandler() {
}

export function overrideLocale(locale: string): boolean {
const path = NSBundle.mainBundle.pathForResourceOfType(locale.substring(0, 2), 'lproj');
let language_code = locale.substring(0, 2);
if (locale.indexOf('-') < 0 && locale.length == 3) {
language_code = locale;
}

const path = NSBundle.mainBundle.pathForResourceOfType(language_code, 'lproj');

if (!path) {
return false;
Expand All @@ -39,7 +44,7 @@ export function overrideLocale(locale: string): boolean {
bundle = NSBundle.bundleWithPath(path);
NSUserDefaults.standardUserDefaults.setObjectForKey([locale], 'AppleLanguages');
NSUserDefaults.standardUserDefaults.synchronize();
ApplicationSettings.setString('__app__language__', locale.substring(0, 2));
ApplicationSettings.setString('__app__language__', language_code);

return true;
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy