diff --git a/en/application-dev/reference/apis/js-apis-i18n.md b/en/application-dev/reference/apis/js-apis-i18n.md index 27dc8eb464f9615f0b61462a5f7f81d71195d1f1..7a604fdd852e43c09c418312c6797ea96e7fc6e0 100644 --- a/en/application-dev/reference/apis/js-apis-i18n.md +++ b/en/application-dev/reference/apis/js-apis-i18n.md @@ -1,2665 +1,1252 @@ -# Internationalization \(i18n\) +# Internationalization – i18n ->![](public_sys-resources/icon-note.gif) **NOTE:** ->- The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. ->- This module contains enhanced i18n APIs, which are not defined in ECMA 402. +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> - This module contains enhanced i18n APIs, which are not defined in ECMA 402. -## Modules to Import + +## Modules to Import ``` import i18n from '@ohos.i18n'; ``` -## Required Permissions - -None -## i18n.getDisplayLanguage +## i18n.getDisplayLanguage -getDisplayLanguage\(language: string, locale: string, sentenceCase?: boolean\): string +getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string Obtains the localized script for the specified language. -- Parameters - - -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -
---|---|---|
- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the localized script is displayed from right to left, and value false indicates the opposite. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Number of milliseconds that have elapsed since the Unix epoch. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -Start day of a week. The value 1 indicates Sunday, and value 7 indicates Saturday. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Start day of a week. The value 1 indicates Sunday, and value 7 indicates Saturday. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -Value of the specified field. For example, if the year in the internal date of this Calendar object is 1990, the get("year") function will return 1990. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Locale for which the name of the Calendar object is displayed. For example, if locale is en-US, the name of the Buddhist calendar will be Buddhist Calendar. - |
-
- | -- | -
---|---|
- | -Name of the Calendar object displayed for the specified locale. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Specified date in this Calendar object. If this parameter is left unspecified, the system checks whether the current date in the Calendar object is a weekend. - |
-
- | -- | -
---|---|
- | -The value true indicates that the date is a weekend, and value false indicates a weekday. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Country or region to which the phone number to be formatted belongs. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates the phone number format is valid, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -- | -
---|---|---|---|---|
- | -- | -- | -- | -Format type of a phone number. The available options are as follows: E164, INTERNATIONAL, NATIONAL, and RFC3966. - |
-
- | -- | -- | -- | -- | -
---|---|---|---|---|
- | -- | -- | -- | -Name of the measurement unit, for example, meter, inch, or cup. - |
-
- | -- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -Style used for formatting. The value can be long, short, or medium. - |
-
- | -- | -
---|---|
- | -Character string obtained after formatting based on the measurement unit specified by toUnit. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and region. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and region. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is a digit, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is a space, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is a white space, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is of the RTL language, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is an ideographic character, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is a letter, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is a lowercase letter, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the input character is an uppercase letter, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Valid locale value, for example, zh-Hans-CN. The BreakIterator object segments text according to the rules of the specified locale. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Text to be processed by the BreakIterator object. - |
-
- | -- | -
---|---|
- | -Text being processed by the BreakIterator object. - |
-
- | -- | -
---|---|
- | -Position of the BreakIterator object in the text being processed. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Number of text boundaries by which the BreakIterator object is moved. A positive value indicates that the text boundary is moved backward, and a negative value indicates the opposite. If no index is specified, the index will be treated as 1. - |
-
- | -- | -
---|---|
- | -Position of the BreakIterator object in the text after it is moved by the specified number of text boundaries. The value -1 is returned if the position of the BreakIterator object is outside of the processed text after it is moved by the specified number of text boundaries. - |
-
- | -- | -
---|---|
- | -Position of the BreakIterator object in the text after it is moved to the previous text boundary. The value -1 is returned if the position of the BreakIterator object is outside of the processed text after it is moved by the specified number of text boundaries. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Offset to the position before the text boundary to which the BreakIterator object is moved. - |
-
- | -- | -
---|---|
- | -The value -1 is returned if the text boundary to which the BreakIterator object is moved is outside of the processed text. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the position specified by the offset is a text boundary, and value false indicates the opposite. - |
-
- | -- | -
---|---|
- | -The value true indicates that the 24-hour clock is used, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Whether to enable the 24-hour clock. The value true means to enable the 24-hour clock, and value false means the opposite. - |
-
- | -- | -
---|---|
- | -The value true indicates that the 24-hour clock is enabled, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the preferred language is added, and value false indicates the opposite. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -The value true indicates that the preferred language is deleted, and value false indicates the opposite. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and locale. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and locale. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and locale. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and locale. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and locale. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -Number for which the singular-plural type is to be obtained. - |
-
- | -- | -
---|---|
- | -Singular-plural type. The options are as follows: zero, one, two, few, many, and others. - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -A string containing locale information, including the language, optional script, and locale. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -Unit to format. The value can be year, quarter, month, week, day, hour, minute, or second. - |
-
- | -- | -
---|---|
- | -- | -