diff options
author | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 20:42:10 +0000 |
---|---|---|
committer | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 20:42:10 +0000 |
commit | efc15bab6e448ac35df399d5f2a89779c212a751 (patch) | |
tree | 3b3492e8bdea45368e298435938aee710dc52100 /chrome/common/l10n_util.h | |
parent | 1a7375204b8e21dfec1bea87ffa15435c145745f (diff) | |
download | chromium_src-efc15bab6e448ac35df399d5f2a89779c212a751.zip chromium_src-efc15bab6e448ac35df399d5f2a89779c212a751.tar.gz chromium_src-efc15bab6e448ac35df399d5f2a89779c212a751.tar.bz2 |
This CL fix the following 2 bugs:
1.7324 -- RTL: Path contains Hebrew is wrong on "Download location" text box
(http://crbug.com/7324)
2. 7326 -- RTL: Folder icon missing on "Download location" text box
(http://crbug.com/7326)
The fix are:
1. force path to have LTR directionality.
2. draw icon in mirrored position in RTL locales.
Steps for test:
1. Create a folder with a Hebrew file name on Hebrew XP
2. Change the download location to the folder created in step 1
3. Observe the path displayed on "Google Chrome Options" --> "Minor Tweaks" --> "Download location" text box
Without the fix:
The path contains Hebrew folder name is wrong. It displayed as "cCBA\:" while the path is "c:\CBA" where "CBA" is a Hebrew folder name.
And there is no folder icon in the "download location" text box.
With the fix:
The path displayed correctly as "c:\CBA" or "c:\CBA\FED" where "FED" is subfolder of "CBA".
And the folder icon showed at the very right.
Review URL: http://codereview.chromium.org/20038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/l10n_util.h')
-rw-r--r-- | chrome/common/l10n_util.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/common/l10n_util.h b/chrome/common/l10n_util.h index 3f971ac..0c67712 100644 --- a/chrome/common/l10n_util.h +++ b/chrome/common/l10n_util.h @@ -21,17 +21,22 @@ #include "base/basictypes.h" #include "base/logging.h" #include "base/scoped_ptr.h" +#include "base/string16.h" #include "base/string_util.h" #include "third_party/icu38/public/common/unicode/ubidi.h" #include "unicode/coll.h" #include "unicode/locid.h" +class FilePath; class PrefService; namespace l10n_util { -const wchar_t kRightToLeftMark[] = L"\x200f"; -const wchar_t kLeftToRightMark[] = L"\x200e"; +const char16 kRightToLeftMark = 0x200f; +const char16 kLeftToRightMark = 0x200e; +const char16 kLeftToRightEmbeddingMark = 0x202A; +const char16 kRightToLeftEmbeddingMark = 0x202B; +const char16 kPopDirectionalFormatting = 0x202C; // This method is responsible for determining the locale as defined below. In // nearly all cases you shouldn't call this, rather use GetApplicationLocale @@ -151,6 +156,12 @@ void WrapStringWithLTRFormatting(std::wstring* text); // strings are rendered properly in an LTR context. void WrapStringWithRTLFormatting(std::wstring* text); +// Wraps individual file path components to get them to display correctly in an +// RTL UI. All filepaths should be passed through this function before display +// in UI for RTL locales. +void WrapPathWithLTRFormatting(const FilePath& path, + string16* rtl_safe_path); + // Returns the locale-dependent extended window styles. // This function is used for adding locale-dependent extended window styles // (e.g. WS_EX_LAYOUTRTL, WS_EX_RTLREADING, etc.) when creating a window. |