summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 19:53:00 +0000
committerxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 19:53:00 +0000
commit1a3f426f71ee35848e94356dd6bdd423aaff5608 (patch)
tree2fe68d926194ad16627b6db0f7836a34b4ceb841
parent650e4d7f574f4f122e122f11142f53133e467b6d (diff)
downloadchromium_src-1a3f426f71ee35848e94356dd6bdd423aaff5608.zip
chromium_src-1a3f426f71ee35848e94356dd6bdd423aaff5608.tar.gz
chromium_src-1a3f426f71ee35848e94356dd6bdd423aaff5608.tar.bz2
This change list fix issues 6093 [settings] bad directionality for gears button
(http://crbug.com/6093). The directionality of gears button is already fixed. This CL fixes the wrong location of ":". It adds RLM at the end of string "Google Gears:" for Hebrew and Arabic Chrome, so that the ":" in "Google Gears:" in Hebrew is displayed leftmost instead of rightmost. Test: 1) open chrome, Hebrew UI 2) option -> under the hood -> google gears Without the fix, the name appears as "Google Gears:". With the fix, the name appears as ":Google Gears". Review URL: http://codereview.chromium.org/18279 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8205 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/options/advanced_contents_view.cc11
-rw-r--r--chrome/common/l10n_util.cc2
-rw-r--r--chrome/common/l10n_util.h5
3 files changed, 15 insertions, 3 deletions
diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc
index d3860e6..c73b858 100644
--- a/chrome/browser/views/options/advanced_contents_view.cc
+++ b/chrome/browser/views/options/advanced_contents_view.cc
@@ -685,8 +685,15 @@ void WebContentSection::InitControlLayout() {
l10n_util::GetString(IDS_OPTIONS_SHOWPOPUPBLOCKEDNOTIFICATION));
popup_blocked_notification_checkbox_->SetListener(this);
- gears_label_ = new views::Label(
- l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_GROUP_NAME));
+ if (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) {
+ gears_label_ = new views::Label(
+ l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_GROUP_NAME));
+ } else {
+ // Add an RTL mark so that
+ // ":" in "Google Gears:" in Hebrew Chrome is displayed left-most.
+ gears_label_ = new views::Label(l10n_util::GetString(
+ IDS_OPTIONS_GEARSSETTINGS_GROUP_NAME) + l10n_util::kRightToLeftMark);
+ }
gears_settings_button_ = new views::NativeButton(
l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_CONFIGUREGEARS_BUTTON));
gears_settings_button_->SetListener(this);
diff --git a/chrome/common/l10n_util.cc b/chrome/common/l10n_util.cc
index f783aad..d9fb299 100644
--- a/chrome/common/l10n_util.cc
+++ b/chrome/common/l10n_util.cc
@@ -313,7 +313,7 @@ std::wstring GetLocalName(const std::wstring& locale_code_wstr,
name_local.resize(actual_size);
// Add an RTL mark so parentheses are properly placed.
if (is_for_ui && GetTextDirection() == RIGHT_TO_LEFT)
- return name_local + L"\x200f";
+ return name_local + kRightToLeftMark;
else
return name_local;
}
diff --git a/chrome/common/l10n_util.h b/chrome/common/l10n_util.h
index 7631a1f..b5dd18a 100644
--- a/chrome/common/l10n_util.h
+++ b/chrome/common/l10n_util.h
@@ -23,6 +23,8 @@ class PrefService;
namespace l10n_util {
+const wchar_t kRightToLeftMark[] = L"\x200f";
+
// This method is responsible for determining the locale as defined below. In
// nearly all cases you shouldn't call this, rather use GetApplicationLocale
// defined on browser_process.
@@ -147,6 +149,9 @@ void WrapStringWithRTLFormatting(std::wstring* text);
// Callers should OR this value into their extended style value when creating
// a window.
int GetExtendedStyles();
+
+// TODO(xji):
+// This is a temporary name, it will eventually replace GetExtendedStyles
int GetExtendedTooltipStyles();
// Returns the default text alignment to be used when drawing text on a