From 88efd32962f17b4135171c4c99d313abd550cc3e Mon Sep 17 00:00:00 2001 From: sunyaozu Date: Fri, 12 Nov 2021 11:21:47 +0800 Subject: [PATCH] add isRTL to i18n Signed-off-by: sunyaozu --- api/@ohos.i18n.d.ts | 10 ++++++++++ api/@ohos.intl.d.ts | 20 +++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index 3001b54bd8..e2eb1d84cf 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -285,4 +285,14 @@ export class Calendar { */ isWeekend(date?: Date): boolean; } + +/** + * Judge whether the locale is RTL locale. + * + * @param locale The locale to be used. + * @return Returns true representing the locale is an RTL locale + * + * @since 8 + */ +export function isRTL(locale: string): boolean; } \ No newline at end of file diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts index 5cfb03b1f0..f5e7a7cceb 100755 --- a/api/@ohos.intl.d.ts +++ b/api/@ohos.intl.d.ts @@ -225,22 +225,19 @@ export class DateTimeFormat { /** * A constructor used to create a DateTimeFormat object. * - * @param locale Indicates a character string containing the locale information, including - * the language and optionally the script and region, for the DateTimeFormat object. - * @param options Indicates the options used to format the date. - * @since 6 + * @since 8 */ - constructor(locale: string, options?: DateTimeOptions); + constructor(); /** * A constructor used to create a DateTimeFormat object. * - * @param locale Indicates an array of character string containing the locale information, including + * @param locale Indicates character string containing the locale information, including * the language and optionally the script and region, for the DateTimeFormat object. * @param options Indicates the options used to format the date. * @since 6 */ - constructor(locale: Array, options?: DateTimeOptions); + constructor(locale: string | Array, options?: DateTimeOptions); /** * Obtains the formatted date strings. @@ -372,22 +369,19 @@ export class NumberFormat { /** * A constructor used to create a NumberFormat object. * - * @param locale Indicates a character string containing the locale information, including - * the language and optionally the script and region, for the NumberFormat object. - * @param options Indicates the options used to format the number. * @since 6 */ - constructor(locale: string, options?: NumberOptions); + constructor(); /** * A constructor used to create a NumberFormat object. * - * @param locale Indicates an array of character string containing the locale information, including + * @param locale Indicates a character string containing the locale information, including * the language and optionally the script and region, for the NumberFormat object. * @param options Indicates the options used to format the number. * @since 6 */ - constructor(locale: Array, options?: NumberOptions); + constructor(locale: string | Array, options?: NumberOptions); /** * Obtains the formatted number string. -- Gitee