diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index 47fb1626c33ba25e6a955979e5f6888a51f8b51e..8bc592662308c7bfe4784b4f5e58b7702366d7d9 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -156,6 +156,17 @@ export interface Util { * @since 8 */ unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string; + + /** + * Get the order of year, month, day in the specified locale. Year, month, day are separated by '-'. + * 'y' stands for year, 'L' stands for month, d stands for day. + * + * @syscap SystemCapability.Global.I18n + * @param locale Information of the locale + * @return Returns the string of 'y', 'L', 'd' joined by '-'. + * @since 9 + */ + getDateOrder(locale: string): string; } /** @@ -727,5 +738,44 @@ export class TimeZone { */ getOffset(date?: number): number; } + +/** + * Provides the API for transliterate text from one format to another. + * + * @syscap SystemCapability.Global.I18n + * @since 9 + */ +export class Transliterator { + /** + * Get a string array of all available transliterator ids. + * + * @syscap SystemCapability.Global.I18n + * @return Returns a string array of all available transliterator ids. + * @since 9 + */ + static getAvailableIDs(): string[]; + + /** + * Get a Transliterator that is specified by id name. + * + * @syscap SystemCapability.Global.I18n + * @param id specified the type of Transliterator. id is formed by source and dest. Transliterator will tranliste + * the input string from source format to the dest format. For example, a Simplified Chinese to Latn + * Transliterator will transform the text written in Chinese to Latn characters. + * @return Returns Transliterator that is specified by id name. + * @since 9 + */ + static getInstance(id: string): Transliterator; + + /** + * Transform the input text. + * + * @syscap SystemCapability.Global.I18n + * @param id text to be transliterated. + * @return Returns the output text that is tranlisterated from source format to the dest format. + * @since 9 + */ + transform(text: string): string; +} } -export default i18n; \ No newline at end of file +export default i18n;