Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: base/i18n/rtl.cc

Issue 1254933002: Support XCode's "Right to Left Pseudolanguage" on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/ios/ios_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/rtl.cc
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc
index 1cccae289375f92495963cee7bbc9341167a8a48..1c873a60e622e386e04603fc2dccc6a21eb71aae 100644
--- a/base/i18n/rtl.cc
+++ b/base/i18n/rtl.cc
@@ -14,6 +14,10 @@
#include "third_party/icu/source/common/unicode/uscript.h"
#include "third_party/icu/source/i18n/unicode/coll.h"
+#if defined(OS_IOS)
+#include "base/ios/ios_util.h"
+#endif
+
namespace {
// Extract language, country and variant, but ignore keywords. For example,
@@ -131,6 +135,11 @@ bool ICUIsRTL() {
}
TextDirection GetTextDirectionForLocale(const char* locale_name) {
+ // On iOS, check for RTL forcing.
+#if defined(OS_IOS)
+ if (ios::IsForcingRTL())
jungshik at Google 2015/08/07 17:32:22 nit: How about IsInForcedRTL ?
marq (ping after 24h) 2015/08/10 07:28:37 Done.
+ return RIGHT_TO_LEFT;
+#endif
UErrorCode status = U_ZERO_ERROR;
ULayoutType layout_dir = uloc_getCharacterOrientation(locale_name, &status);
DCHECK(U_SUCCESS(status));
« no previous file with comments | « no previous file | base/ios/ios_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698