1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * Provides international settings related APIs. 18 * 19 * @since 7 20 * @devices phone, tablet, tv, wearable, car 21 */ 22declare namespace i18n { 23/** 24 * Obtains the country or region name localized for display on a given locale. 25 * 26 * @param country The locale whose country or region name will be displayed. 27 * @param locale The locale used to display the country or region. 28 * @param sentenceCase Specifies whether the country or region name is displayed in sentence case. 29 * @return Returns the country or region name localized for display on a given locale. 30 * @since 7 31 */ 32export function getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; 33 34/** 35 * Obtains the language name localized for display on a given locale. 36 * 37 * @param language The locale whose language name will be displayed. 38 * @param locale The locale used to display the language. 39 * @param sentenceCase Specifies whether the language name is displayed in sentence case. 40 * @return Returns the language name localized for display on a given locale. 41 * @since 7 42 */ 43export function getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; 44 45/** 46 * Obtain all languages supported by the system. 47 * 48 * @return Returns all languages supported by the system. 49 * @since 7 50 * @systemapi Hide this for inner system use. 51 */ 52export function getSystemLanguages(): Array<string>; 53 54/** 55 * Obtain all regions supported by the system in the language. 56 * 57 * @param language The language used to get the list of regions. 58 * @return Returns all regions supported by the system in the language. 59 * @since 7 60 * @systemapi Hide this for inner system use. 61 */ 62export function getSystemCountries(language: string): Array<string>; 63 64/** 65 * Determine whether the current language or region is recommended. 66 * 67 * @param language The language code. 68 * @param region The region code. 69 * @return Returns whether the current language or region is recommended. 70 * @since 7 71 * @systemapi Hide this for inner system use. 72 */ 73export function isSuggested(language: string, region?: string): boolean; 74 75/** 76 * Obtain the language currently used by the system. 77 * 78 * @return Returns the language currently used by the system. 79 * @since 7 80 */ 81export function getSystemLanguage(): string; 82 83/** 84 * Set the language currently used by the system. 85 * 86 * @param language The language to be used. 87 * @since 7 88 * @systemapi Hide this for inner system use. 89 */ 90export function setSystemLanguage(language: string): boolean; 91 92/** 93 * Obtain the region currently used by the system. 94 * 95 * @return Returns the region currently used by the system. 96 * @since 7 97 */ 98export function getSystemRegion(): string; 99 100/** 101 * Set the region currently used by the system. 102 * 103 * @param region The region to be used. 104 * @since 7 105 * @systemapi Hide this for inner system use. 106 */ 107export function setSystemRegion(region: string): boolean; 108 109/** 110 * Obtain the locale currently used by the system. 111 * 112 * @return Returns the locale currently used by the system. 113 * @since 7 114 */ 115export function getSystemLocale(): string; 116 117/** 118 * Set the locale currently used by the system. 119 * 120 * @param locale The locale to be used. 121 * @since 7 122 * @systemapi Hide this for inner system use. 123 */ 124export function setSystemLocale(locale: string): boolean; 125}