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

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, 4 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 96ef9aaecd257b16b9e8054e90c5421776a5e8c8..25a9cfd2ed314d9fc143c9315dce083d2da4266a 100644
--- a/base/i18n/rtl.cc
+++ b/base/i18n/rtl.cc
@@ -15,6 +15,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,
@@ -141,6 +145,13 @@ TextDirection GetTextDirectionForLocale(const char* locale_name) {
if (StartsWith(locale_name, kEnglishLocale, CompareCase::SENSITIVE))
return LEFT_TO_RIGHT;
}
+
+ // On iOS, check for RTL forcing.
+#if defined(OS_IOS)
+ if (ios::IsInForcedRTL())
+ 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