OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/l10n/l10n_util.h" | 5 #include "ui/base/l10n/l10n_util.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <glib/gutils.h> | 8 #include <glib/gutils.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 return false; | 313 return false; |
314 } | 314 } |
315 #endif | 315 #endif |
316 | 316 |
317 // On Linux, the text layout engine Pango determines paragraph directionality | 317 // On Linux, the text layout engine Pango determines paragraph directionality |
318 // by looking at the first strongly-directional character in the text. This | 318 // by looking at the first strongly-directional character in the text. This |
319 // means text such as "Google Chrome foo bar..." will be layed out LTR even | 319 // means text such as "Google Chrome foo bar..." will be layed out LTR even |
320 // if "foo bar" is RTL. So this function prepends the necessary RLM in such | 320 // if "foo bar" is RTL. So this function prepends the necessary RLM in such |
321 // cases. | 321 // cases. |
322 void AdjustParagraphDirectionality(string16* paragraph) { | 322 void AdjustParagraphDirectionality(string16* paragraph) { |
323 #if defined(OS_LINUX) | 323 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
324 if (base::i18n::IsRTL() && | 324 if (base::i18n::IsRTL() && |
325 base::i18n::StringContainsStrongRTLChars(*paragraph)) { | 325 base::i18n::StringContainsStrongRTLChars(*paragraph)) { |
326 paragraph->insert(0, 1, static_cast<char16>(base::i18n::kRightToLeftMark)); | 326 paragraph->insert(0, 1, static_cast<char16>(base::i18n::kRightToLeftMark)); |
327 } | 327 } |
328 #endif | 328 #endif |
329 } | 329 } |
330 | 330 |
331 #if defined(OS_WIN) | 331 #if defined(OS_WIN) |
332 std::string GetCanonicalLocale(const std::string& locale) { | 332 std::string GetCanonicalLocale(const std::string& locale) { |
333 return base::i18n::GetCanonicalLocale(locale.c_str()); | 333 return base::i18n::GetCanonicalLocale(locale.c_str()); |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) { | 851 for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) { |
852 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale)) | 852 if (!IsLocaleNameTranslated(kAcceptLanguageList[i], display_locale)) |
853 // TODO(jungshik) : Put them at the of the list with language codes | 853 // TODO(jungshik) : Put them at the of the list with language codes |
854 // enclosed by brackets instead of skipping. | 854 // enclosed by brackets instead of skipping. |
855 continue; | 855 continue; |
856 locale_codes->push_back(kAcceptLanguageList[i]); | 856 locale_codes->push_back(kAcceptLanguageList[i]); |
857 } | 857 } |
858 } | 858 } |
859 | 859 |
860 } // namespace l10n_util | 860 } // namespace l10n_util |
OLD | NEW |