Internationalization plugin for NativeScript using native capabilities of each platform
79
stars
31
forks
source link
RESTART automatically a nativescript 8 angular app after close -exit or finish - that app to change the app language #109
Open
ittrad-mobile-lab opened 2 years ago
I'm wondering if there is a way to automatically restart the app after an exit in IOS or a finish in android used to change the app language.
To be more precise, in the official NS documentation (https://docs.nativescript.org/plugins/localize.html#how-to-change-the-language-dynamically-at-runtime ) I found this code (see below alert ...) I wish to complete ????? (see code below) with a method (if is possible) that will RESTART the app after close.
`import { Application } from '@nativescript/core' import { overrideLocale } from '@nativescript/localize'
alert({ title: 'Switch Language', message: 'The application needs to be restarted to change language', okButtonText: 'Quit!' }).then(() => { L.localize.overrideLocale(selectedLang) if (isAndroid) { ;( Application.android.foregroundActivity || Application.android.startActivity ).finish()
} else { exit(0) // Here I need a method to RESTART the app automatically after exit ????? } })`