1# System Language and Region Setting
2
3
4## How It Works
5
6You can add multiple languages in the **Language & region** area in **Settings**. The list formed by multiple languages is called a language list, and the first language in the list is called the system language. Regions are divided based on the region ID.
7
8When you set or switch the system language, the system checks whether the [extended parameter](i18n-locale-culture.md) matches the system language. If they do not match, the system deletes the extended parameter. For example, if the current system language is **ar** and the local numeral system is **arab**, the local numeral system will be changed to **mymr** once you switch the system language to **my**. If you switch the language to Chinese, the Arabic numeral system is used because local numerals are not supported. Meanwhile, the extended parameter associated with the numeral system is removed.
9
10
11## How to Develop
12
13For details about how to use related APIs, see [System](../reference/apis-localization-kit/js-apis-i18n.md#system9).
14
151. Import the **i18n** module.
16   ```ts
17   import { i18n } from '@kit.LocalizationKit';
18   import { BusinessError } from '@kit.BasicServicesKit';
19   ```
20
212. Obtain the system language, region, and locale.
22   ```ts
23   // Obtain the system language.
24   let systemLanguage = i18n.System.getSystemLanguage();  // systemLanguage indicates the current system language.
25
26   // Obtain the system region.
27   let systemRegion = i18n.System.getSystemRegion();  // systemRegion indicates the current system region.
28
29   // Obtain the system locale.
30   let systemLocale = i18n.System.getSystemLocale();  // systemLocale is the current system locale.
31   ```
32<!--Del-->
333. Set the system language, region, and locale.
34   ```ts
35   // Set the current system language to zh.
36   try {
37     i18n.System.setSystemLanguage('zh');
38   } catch(error) {
39     let err: BusinessError = error as BusinessError;
40     console.error(`call System.setSystemLanguage failed, error code: ${err.code}, message: ${err.message}.`);
41   }
42
43   // Set the current system region to CN.
44   try {
45     i18n.System.setSystemRegion('CN');
46   } catch(error) {
47     let err: BusinessError = error as BusinessError;
48     console.error(`call System.setSystemRegion failed, error code: ${err.code}, message: ${err.message}.`);
49   }
50
51   // Set the current system locale to zh-Hans-CN.
52   try {
53     i18n.System.setSystemLocale('zh-Hans-CN');
54   } catch(error) {
55     let err: BusinessError = error as BusinessError;
56     console.error(`call System.setSystemLocale failed, error code: ${err.code}, message: ${err.message}.`);
57   }
58   ```
59<!--DelEnd-->
60