1e41f4b71Sopenharmony_ci# Globalization Subsystem ChangeLog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## cl.global.1 Runtime Authentication Added for System APIs
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ciThe internationalization component of the globalization subsystem adds runtime authentication for system APIs in certain scenarios. The following changes are made in API version 9 and later:
6e41f4b71Sopenharmony_ci - Setting the system language, country or region, and area
7e41f4b71Sopenharmony_ci - Setting the 24-hour format of the system
8e41f4b71Sopenharmony_ci - Adding and removing the preferred language
9e41f4b71Sopenharmony_ci - Setting localized numbers
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciYou need to adapt your application based on the following information.
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci**Change Impacts**
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ciAPIs involved in the preceding scenarios can be properly called only by system applications that have the **UPDATE_CONFIGURATION** permission.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci**Key API/Component Changes**
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci - Involved APIs:
20e41f4b71Sopenharmony_ci   - setSystemLanguage(language: string): void;
21e41f4b71Sopenharmony_ci   - setSystemRegion(region: string): void;
22e41f4b71Sopenharmony_ci   - setSystemLocale(locale: string): void;
23e41f4b71Sopenharmony_ci   - set24HourClock(option: boolean): void;
24e41f4b71Sopenharmony_ci   - addPreferredLanguage(language: string, index?: number): void;
25e41f4b71Sopenharmony_ci   - removePreferredLanguage(index: number): void;
26e41f4b71Sopenharmony_ci   - setUsingLocalDigit(flag: boolean): void;
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci**Adaptation Guide**
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ciMake sure the application trying to call any of the above APIs is a system application. Non-system applications are not allowed to call the APIs.
31e41f4b71Sopenharmony_ciAn exception will be thrown upon lack of a necessary permission or a call request from a non-system application. The exception can be captured via **try-catch**.
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci```js
34e41f4b71Sopenharmony_ciimport I18n from '@ohos.i18n'
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_citry {
37e41f4b71Sopenharmony_ci  I18n.System.setSystemLanguage('zh');
38e41f4b71Sopenharmony_ci} catch(error) {
39e41f4b71Sopenharmony_ci  console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`)
40e41f4b71Sopenharmony_ci}
41e41f4b71Sopenharmony_ci```
42