@@ -12,29 +12,34 @@ link: https://raw.githubusercontent.com/NativeScript/plugins/main/packages/local
12
12
13
13
## Contents
14
14
15
- - [ Installation] ( #installation )
16
- - [ Use @nativescript/localize ] ( #use-nativescriptlocalize )
17
- - [ Localization in NativeScript Core] ( #localization-in-nativescript-core )
18
- - [ Quirks] ( #quirks )
19
- - [ Localization in Angular] ( #localization-in-angular )
15
+ - [ @nativescript/localize ] ( #nativescriptlocalize )
16
+ - [ Contents] ( #contents )
17
+ - [ Intro] ( #intro )
18
+ - [ Installation] ( #installation )
19
+ - [ Use @nativescript/localize ] ( #use-nativescriptlocalize )
20
+ - [ Localization in NativeScript Core] ( #localization-in-nativescript-core )
21
+ - [ Quirks] ( #quirks )
22
+ - [ Localization in Angular] ( #localization-in-angular )
20
23
- [ Localization in Vue] ( #localization-in-vue )
21
- - [ Localization in Svelte] ( #localization-in-svelte )
22
- - [ Setting the Default Language] ( #setting-the-default-language )
23
- - [ Localizing the Application Name] ( #localizing-the-application-name )
24
- - [ Localizing iOS properties?] ( #how-to-localize-ios-properties )
24
+ - [ Localization in Svelte] ( #localization-in-svelte )
25
+ - [ Setting the default language] ( #setting-the-default-language )
26
+ - [ Localizing the application name] ( #localizing-the-application-name )
27
+ - [ File format] ( #file-format )
28
+ - [ JSON] ( #json )
29
+ - [ Javascript] ( #javascript )
30
+ - [ Localizing iOS properties] ( #localizing-ios-properties )
25
31
- [ Changing the language dynamically at runtime] ( #changing-the-language-dynamically-at-runtime )
26
- - [ iOS] ( #ios )
27
- - [ Android] ( #android )
28
- - [ File format] ( #file-format )
29
- - [ Troubleshooting] ( #troubleshooting )
30
- - [ Angular localization pipe and the modal context] ( #the-angular-localization-pipe-and-the-modal-context )
31
- - [ Issues with WebView on Android N+] ( #issues-with-webview-on-android-n )
32
- - [ API] ( #api )
33
- - [ localize()] ( #localize )
34
- - [ overrideLocale()] ( #overridelocale )
35
- - [ androidLaunchEventLocalizationHandler()] ( #androidlauncheventlocalizationhandler )
36
- - [ Credits] ( #credits )
37
- - [ License] ( #license )
32
+ - [ iOS] ( #ios )
33
+ - [ Android] ( #android )
34
+ - [ Troubleshooting] ( #troubleshooting )
35
+ - [ Angular localization pipe and the modal context] ( #angular-localization-pipe-and-the-modal-context )
36
+ - [ Issues with WebView on Android N+] ( #issues-with-webview-on-android-n )
37
+ - [ API] ( #api )
38
+ - [ localize()] ( #localize )
39
+ - [ overrideLocale()] ( #overridelocale )
40
+ - [ androidLaunchEventLocalizationHandler()] ( #androidlauncheventlocalizationhandler )
41
+ - [ Credits] ( #credits )
42
+ - [ License] ( #license )
38
43
39
44
## Intro
40
45
@@ -337,7 +342,7 @@ On both platforms, after calling `overrideLocale` method, you must ask the user
337
342
For Example:
338
343
339
344
``` ts
340
- import { Application } from ' @nativescript/core'
345
+ import { Application , Utils } from ' @nativescript/core'
341
346
import { overrideLocale } from ' @nativescript/localize'
342
347
343
348
alert ({
@@ -347,9 +352,7 @@ alert({
347
352
}).then (() => {
348
353
L .localize .overrideLocale (selectedLang )
349
354
if (isAndroid ) {
350
- ;(
351
- Application .android .foregroundActivity || Application .android .startActivity
352
- ).finish ()
355
+ Utils .android .getCurrentActivity ().finish ()
353
356
} else {
354
357
exit (0 )
355
358
}
0 commit comments