From c34921b657b912a3e159ef383db6e37af1dc2596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=89=91?= Date: Sat, 24 May 2025 15:44:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=A8=E5=B9=B3=E5=8F=B0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=BA=94=E7=94=A8=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.i18n.d.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index c20a525bd..8192e4dbc 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -558,6 +558,20 @@ declare namespace i18n { * @atomicservice * @since 12 */ + /** + * Sets the preferred language of the application. Resources are loaded in the preferred language when the + * application is launched. If the preferred language is set to default, the application's language will be the + * same as the system language, and the setting will take effect upon cold starting of the application. + * + * @param { string } language - Valid language ID or default. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 890001 - Invalid parameter. Possible causes: Parameter verification failed. + * @syscap SystemCapability.Global.I18n + * @crossplatform + * @atomicservice + * @since 20 + */ static setAppPreferredLanguage(language: string): void; /** @@ -575,6 +589,15 @@ declare namespace i18n { * @atomicservice * @since 12 */ + /** + * Obtains the preferred language of an application. + * + * @returns { string } Preferred language of the application. + * @syscap SystemCapability.Global.I18n + * @crossplatform + * @atomicservice + * @since 20 + */ static getAppPreferredLanguage(): string; /** -- Gitee