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

Unified Diff: base/i18n/rtl.cc

Issue 10910128: Check string and UI direction in GetDisplayStringInLTRDirectionality, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USE ARRAYSIZE_UNSAFE for unnamed struct arrays. Created 8 years, 3 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
Index: base/i18n/rtl.cc
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc
index 29a2a88d555e6d2164b6f7acf23eba6631fc5890..9e71928e4116d6b8aa9371e4990a2e9b0bcdeede 100644
--- a/base/i18n/rtl.cc
+++ b/base/i18n/rtl.cc
@@ -319,7 +319,9 @@ void WrapPathWithLTRFormatting(const FilePath& path,
}
string16 GetDisplayStringInLTRDirectionality(const string16& text) {
- if (!IsRTL())
+ // Always wrap the string in RTL UI (it may be appended to RTL string).
+ // Also wrap strings with an RTL first strong character direction in LTR UI.
+ if (!IsRTL() && GetFirstStrongCharacterDirection(text) == LEFT_TO_RIGHT)
xji 2012/09/10 18:07:26 why RTL locale is specially handled (always wrap i
msw 2012/09/10 18:37:31 I don't know about Mac/GTK, but Win and CrOs use f
xji 2012/09/10 22:27:57 In English windows (windows xp), if a user does no
msw 2012/09/10 22:46:13 Cool, this still avoids adding them in LTR for LTR
jungshik at Google 2012/09/12 20:24:35 Can we match the comment and if-statement? At firs
msw 2012/09/12 20:46:52 Done, flipped condition & blocks. See my comment a
return text;
string16 text_mutable(text);
WrapStringWithLTRFormatting(&text_mutable);
« no previous file with comments | « base/i18n/rtl.h ('k') | base/i18n/rtl_unittest.cc » ('j') | base/i18n/rtl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698