mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-11-23 15:10:32 +00:00
add isRTL innerkits to i18n
Signed-off-by: sunyaozu <sunyaozu@huawei.com>
This commit is contained in:
parent
ddfe623fb0
commit
576474f1fe
33
interfaces/native/innerkits/i18n/include/locale_util.h
Normal file
33
interfaces/native/innerkits/i18n/include/locale_util.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef I18N_STANDARD_ISRTL_LOCALE_UTIL_H
|
||||
#define I18N_STANDARD_ISRTL_LOCALE_UTIL_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "locid.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Global {
|
||||
namespace I18n {
|
||||
static inline bool IsRTL(const std::string &locale)
|
||||
{
|
||||
icu::Locale curLocale(locale.c_str());
|
||||
return curLocale.isRightToLeft();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user