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

fix: Disable unsupported langs #2053

Merged
merged 3 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ enableBatchedStateUpdates();

LogBox.ignoreLogs(["The 'navigation' object hasn't been initialized"]);

try {
const isRTLEnabled = true;
I18nManager.allowRTL(isRTLEnabled);
I18nManager.swapLeftAndRightInRTL(isRTLEnabled);
} catch (e) {}
// try {
// const isRTLEnabled = true;
// I18nManager.allowRTL(isRTLEnabled);
// I18nManager.swapLeftAndRightInRTL(isRTLEnabled);
// } catch (e) {}

if (__DEV__ && IS_IOS) {
messaging().setAPNSToken('dev-apns-token', 'sandbox');
Expand Down
4 changes: 3 additions & 1 deletion src/models/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
if (!this.current) {
// Use system language or English as default if user doesn't select another one
let current = this.getDeviceLanguage();
if (!supportedTranslationsMap[current]) current = AppLanguage.en;

Check warning on line 19 in src/models/language.ts

View workflow job for this annotation

GitHub Actions / build_and_test

Expected { after 'if' condition
this.current = current;
}

this.keys = supportedTranslationsMap[this.current];
this.keys =
supportedTranslationsMap[this.current] ??
supportedTranslationsMap[AppLanguage.en];
// @ts-ignore
this.hash = this.keys._hash;

Expand Down