nativescript-localize icon indicating copy to clipboard operation
nativescript-localize copied to clipboard

New OverrideLocale function doesn't work on Android

Open panagulis72 opened this issue 6 years ago • 9 comments

The new overrideLocale function (with 4.2 version of this plugin) doesn't work with Android

panagulis72 avatar Jul 11 '19 09:07 panagulis72

P.S. If i change the language and I use overrideLocale it doesn't change the old translations, even if I use this.cdr.detectChanges(); Any suggestion?

panagulis72 avatar Jul 11 '19 10:07 panagulis72

Nobody?

panagulis72 avatar Jul 15 '19 06:07 panagulis72

any suggestion ?

webmeemba avatar Sep 17 '19 16:09 webmeemba

@panagulis72 - found any work around for this?

harshitjain0803 avatar May 26 '20 11:05 harshitjain0803

@harshitjain0803 I'm sorry, I didn't

panagulis72 avatar May 26 '20 12:05 panagulis72

@panagulis72 - Try to call androidLaunchEventLocalizationHandler() after overrideLocale().

emog avatar Jul 04 '20 15:07 emog

@emog call androidLaunchEventLocalizationHandler() after overrideLocale(). make it works. but after kill the app and reopen again, the app language back to default device's language. how to make it display with the language selected instead of showing default device's language?

wyong95 avatar Jul 20 '20 03:07 wyong95

@wyong95 Try adding this in app.component.ts import { on, launchEvent } from '@nativescript/core/application'; import { androidLaunchEventLocalizationHandler } from 'nativescript-localize/localize';

on(launchEvent, (args) => { if (args.android) { androidLaunchEventLocalizationHandler(); } });

@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) .......

i am able to see the changed language after killing the app and again reopening it, but there is jerk on screen

itsmerockingagain avatar Dec 04 '20 13:12 itsmerockingagain

Possible solution for this (worked for me and someone else, too) can be found here: https://github.com/EddyVerbruggen/nativescript-localize/issues/98

AdrianHavengaBennett avatar Feb 15 '22 11:02 AdrianHavengaBennett