summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Hajdan <phajdan.jr@gentoo.org>2010-11-04 20:58:33 +0000
committerPaweł Hajdan <phajdan.jr@gentoo.org>2010-11-04 20:58:33 +0000
commita3d0dce361d33f24800b4ff6a2647e4688d64a6e (patch)
tree1524d8767288860ab3f3670bc42e4cf227ee0dfd /www-client/chromium
parentVersion bump. (diff)
downloadhistorical-a3d0dce361d33f24800b4ff6a2647e4688d64a6e.tar.gz
historical-a3d0dce361d33f24800b4ff6a2647e4688d64a6e.tar.bz2
historical-a3d0dce361d33f24800b4ff6a2647e4688d64a6e.zip
Version bump for beta and stable channel releases. Fix bug #343971 by Sok Ann Yap <sokann@gmail.com>. Lower cups dependency to 1.3.x everywhere, it is just too much trouble to maintain. Remove old.
Package-Manager: portage-2.1.8.3/cvs/Linux i686
Diffstat (limited to 'www-client/chromium')
-rw-r--r--www-client/chromium/ChangeLog14
-rw-r--r--www-client/chromium/Manifest15
-rw-r--r--www-client/chromium/chromium-7.0.517.44.ebuild (renamed from www-client/chromium/chromium-7.0.517.41-r1.ebuild)7
-rw-r--r--www-client/chromium/chromium-8.0.552.28.ebuild (renamed from www-client/chromium/chromium-8.0.552.23.ebuild)7
-rw-r--r--www-client/chromium/chromium-9.0.570.0.ebuild4
-rw-r--r--www-client/chromium/chromium-9999.ebuild4
-rw-r--r--www-client/chromium/files/chromium-locale-glib-r0.patch415
-rw-r--r--www-client/chromium/files/chromium-locale-glib-r1.patch415
8 files changed, 866 insertions, 15 deletions
diff --git a/www-client/chromium/ChangeLog b/www-client/chromium/ChangeLog
index e313ed15bfab..33147f397ce2 100644
--- a/www-client/chromium/ChangeLog
+++ b/www-client/chromium/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for www-client/chromium
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.214 2010/11/03 17:56:06 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.215 2010/11/04 20:58:33 phajdan.jr Exp $
+
+*chromium-8.0.552.28 (04 Nov 2010)
+*chromium-7.0.517.44 (04 Nov 2010)
+
+ 04 Nov 2010; Pawel Hajdan jr <phajdan.jr@gentoo.org>
+ +files/chromium-locale-glib-r0.patch, -chromium-7.0.517.41-r1.ebuild,
+ -chromium-8.0.552.23.ebuild, +files/chromium-locale-glib-r1.patch,
+ +chromium-7.0.517.44.ebuild, +chromium-8.0.552.28.ebuild,
+ chromium-9.0.570.0.ebuild, chromium-9999.ebuild:
+ Version bump for beta and stable channel releases. Fix bug #343971 by Sok
+ Ann Yap <sokann@gmail.com>. Lower cups dependency to 1.3.x everywhere, it
+ is just too much trouble to maintain. Remove old.
03 Nov 2010; Pawel Hajdan jr <phajdan.jr@gentoo.org>
chromium-9.0.570.0.ebuild, chromium-9999.ebuild:
diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
index 79ceffca551a..e9b89082899b 100644
--- a/www-client/chromium/Manifest
+++ b/www-client/chromium/Manifest
@@ -1,6 +1,8 @@
AUX chromium-gecko-mediaplayer-r0.patch 590 RMD160 8b01e801ef4a8d3aaa842ab217929e71ebb70a87 SHA1 916ecd1c7a405fc12de579538c07c42cd9e84ecc SHA256 491cfaa353ad965a0cbfe2fc6370e4df5d1cd55398698b838996053f9e46f12c
AUX chromium-gnome-keyring-r0.patch 2842 RMD160 1ac9a6e2785954a7a4f7f60988c8d7c101ad6db8 SHA1 44ee90f3c6632bcad9843cce22865c9c39fd6c8a SHA256 237d85599270b7cc1f83e58e27712f3d65609c325318b0b28ac277d630574c96
AUX chromium-launcher.sh 1143 RMD160 3bc84b886104acdf993e27e1e05218b730bbead1 SHA1 505850d82b0aed48612c32ff36172c924d2debd0 SHA256 bdec73f460377a20c870cc2e8586cdc48183d2f2f6011b7a2573cb294dd08e28
+AUX chromium-locale-glib-r0.patch 14967 RMD160 4764e11584bc796004acdfb6f997b01d5045ad8f SHA1 aba8d20bff1753303749f7e1c710529de8077c18 SHA256 afdc118a01b0ca7ba6d524d8e30fde8f6bf2cb2ec29959a788e5636066a53b06
+AUX chromium-locale-glib-r1.patch 14823 RMD160 78159c294e953941b35346fc3b228ccbdd988b0d SHA1 b6de887cc67e3db01edb22ccd2eec3048f34df87 SHA256 71b1c2c3cd7382938e1cb4097428ded1dd019b8ef6be3ed6e882647e8e65b2f6
AUX chromium-make-3.82-compatibility-r0.patch 867 RMD160 d6fd01bcd32460678e1503ca9fbeb78ed16e8213 SHA1 9964cbe8063140312dd1217327f3648dfaf71284 SHA256 339f8022d0a2ff733d779ba8c4a3cf09a28633afccc0106d86289ef497f2f401
AUX chromium-plugins-path-r0.patch 1043 RMD160 698a8562c866e046b1adf8553894ee08afb53a10 SHA1 0c41adad38478c4a12970af774e782ebb208a048 SHA256 3ba3bf1c3184fb2a0c7f493947d620fd1678efdd3661ac36be3d1cb00146d108
AUX chromium-system-icu-r0.patch 705 RMD160 88ace1e61e1da871fec979e23b0242e8e5ba6cd2 SHA1 40af48ef29ff8bd533181bf0c172cc67b3237157 SHA256 5e5b884e499b4dc97563bb4cb87ea770542cd044b99f26c7f82e38b89b40de69
@@ -10,12 +12,13 @@ AUX chromium-system-ssl-r0.patch 460 RMD160 50a5a212ed859d9987d2c59bc1d2a6c2e56a
AUX chromium.xml 390 RMD160 6b2f901da76555a7112f71a6f9dae6e2e3307324 SHA1 81148a0b094bc697ff2c9d33efe976b1bffb72a3 SHA256 a81c6257346eaa4f6389fc9ea8834fd2dd3b006cf4e9e999028aca812d76fe9a
AUX v8.gyp 2602 RMD160 2949c9e2d8e2297182130e5984fb5f114c260a81 SHA1 7d32a04a7a921f30b0c3ed33a5593f1059832c96 SHA256 bc5342501d71754f23bd87914bb11841a7487330ba2f0462611dd1b0f99a2a43
DIST chromium-7.0.517.41.tar.bz2 132870680 RMD160 31d2588e4a7d7bc538903c28e0dc3d3de6a63315 SHA1 f8bbd74aaeec073c9eba29326d1316659dab5674 SHA256 0370176f61824f1f7bdb77adb921b91b1bb0213adda2edad34e59c7911a397dc
-DIST chromium-8.0.552.23.tar.bz2 135398668 RMD160 71751959d5639e699636f9462975ce6edbb1402d SHA1 8f698a37a34621cc23b2e2cd8aaf88eeb9877147 SHA256 259ee078bf8dd3788a4ffc0cfbd72f628125920b21bb491516a0160ae451fd18
+DIST chromium-7.0.517.44.tar.bz2 132976535 RMD160 ed7664c7cdf1c4b36c43540d22b4668caccfcef7 SHA1 feeaaa0f26965c9572723b1902ef062cb9cc0ac4 SHA256 ca10b1df650f790e7b6952c1cdc2e968ec0e1f02556dbe9bcb7b4cbcf1bef9dc
+DIST chromium-8.0.552.28.tar.bz2 135220945 RMD160 5b4f44f0772737e06f8e51d8b9a510531da3c689 SHA1 49a00af8b0e2c5711ce42f6eb726b1a8172c70da SHA256 424ecce8357e0fd899e37414841ce5266933e51ebea5a6f04b723eb80e6ef78f
DIST chromium-9.0.570.0.tar.bz2 136854856 RMD160 2aad862a16950ae25a5ed63b9ef0e3c7e1599e28 SHA1 5cb853e84bd9cca483f57cfc05cb0d25cc203771 SHA256 4722cefb8ac7163915d8a9610aedf615e1ac0d3db13fbc24b61cda3f16d03090
-EBUILD chromium-7.0.517.41-r1.ebuild 6614 RMD160 2f5c691328c33965cdbfc257c8be5a98cbaf1903 SHA1 e8a10b032b98c4119c1a2b08c5dfe372535cc497 SHA256 d63ef76dc46a3881582a17f13db9ba8a3df598683bdc18ece3b70abfc3dcf31d
EBUILD chromium-7.0.517.41.ebuild 6605 RMD160 3751c1f28930c71e442c7656ddede271e3230236 SHA1 a965c1c3d75831093b666b02b1d22d3847a73d4a SHA256 57c191137db6de2ab5ed0bd629524a060b71c936d37228bca41d8702ca11753b
-EBUILD chromium-8.0.552.23.ebuild 8030 RMD160 59002b660a5bfd99041496fb88e84941a0c8746c SHA1 7dfd32154e85159824ec6dfd3475fbc87483b66d SHA256 49d51cd5eb0cc703f72ed2a14e7e7fa4bd569adb7d2440ad0350c451f6cddeea
-EBUILD chromium-9.0.570.0.ebuild 7907 RMD160 1776a0e55fb237139dac125f8aa6514bca1e938e SHA1 8c4d50b2b67a1e45f05a7c8c6967c2c107e0a36b SHA256 b20a1d189c8438c8262d2b3ebc7a786c5de70cf000c9609de2709c8bd32f648b
-EBUILD chromium-9999.ebuild 9616 RMD160 7fd7327df2056b089a780c71ddf82e86a8a74a77 SHA1 05c2cfbc2f37b3099b3ed36ed37e00985b348126 SHA256 9c500c352b1f3bd2a094f16cd09043042b535822ddfaaf62bf19ed65dd7e3632
-MISC ChangeLog 46957 RMD160 bfdfb4a4302582bdc096efd0b9701e4dd634ce65 SHA1 0ce386b48be9e495aef8b53b16a938cfeb0de4db SHA256 efbb6e7340e40317369e8160aef0e568557274fa0f0c0e122996a95cf7eb82c8
+EBUILD chromium-7.0.517.44.ebuild 6697 RMD160 d74cebce2399023cc425a2d74574f5ac145da6ed SHA1 bdb8c819d63eb02687150fa2829472e1d911efc7 SHA256 eccc4948dda2e20df7c6f56f5d40cf6417b8ad5e7c343268caa7ac8090f9f30b
+EBUILD chromium-8.0.552.28.ebuild 8116 RMD160 860bf1b6aa4aa4527422700230dce340a7d6a148 SHA1 53c7ecc1723f284360ebd1fa8004025fa52e76ee SHA256 568a2ce0579b4a2d6378457ea4cfc25b683141cf4ecdaac6c183ebcf326465c4
+EBUILD chromium-9.0.570.0.ebuild 7908 RMD160 e563c87ac38c9c80092bea1232977f55bff29ff0 SHA1 0a43fe78c8fbb14e1a9519b4295c856f3c1d7a77 SHA256 183125fdd8310d02d5aca1697f01df17300cb43c8ca820d1102427e792cfec66
+EBUILD chromium-9999.ebuild 9617 RMD160 fd0e9ecf46d329f033881b431400b1657ee6f29c SHA1 f8111a30420f961e37ff5a95981b9438b471a5da SHA256 127792a65a34e8cbf52fe306c9bfa5c9da305d72cac198532839c2b257d38949
+MISC ChangeLog 47540 RMD160 cb879212428609178ddd01b5ac5810a4fec7a224 SHA1 7b55294f6685d0f363e45c950ca09f09a66ad0ce SHA256 dbce8dcb1886679055730ac1726f24a12ab8231443a40306b39dd3132fa40418
MISC metadata.xml 607 RMD160 98f163b667c92c149e6ad82352ff5a1ea076361f SHA1 0d7d96013e31288c37a0e245cf2b538af1a46eaf SHA256 1d94b496c34342ce43cf7b1c6887d90930c0531e903e512d2d132e79e1d0d27d
diff --git a/www-client/chromium/chromium-7.0.517.41-r1.ebuild b/www-client/chromium/chromium-7.0.517.44.ebuild
index 30e125bf50f3..826e64a5ce26 100644
--- a/www-client/chromium/chromium-7.0.517.41-r1.ebuild
+++ b/www-client/chromium/chromium-7.0.517.44.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-7.0.517.41-r1.ebuild,v 1.1 2010/10/19 19:23:35 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-7.0.517.44.ebuild,v 1.1 2010/11/04 20:58:33 phajdan.jr Exp $
EAPI="2"
@@ -26,7 +26,7 @@ RDEPEND="app-arch/bzip2
>=media-libs/alsa-lib-1.0.19
media-libs/jpeg:0
media-libs/libpng
- cups? ( >=net-print/cups-1.4.4 )
+ cups? ( >=net-print/cups-1.3.11 )
sys-libs/zlib
>=x11-libs/gtk+-2.14.7
x11-libs/libXScrnSaver"
@@ -67,6 +67,9 @@ src_prepare() {
# Make compile-time dependency on gnome-keyring optional, bug #332411.
epatch "${FILESDIR}"/${PN}-gnome-keyring-r0.patch
+ # Backport a fix for bug #343971.
+ epatch "${FILESDIR}"/${PN}-locale-glib-r0.patch
+
remove_bundled_lib "third_party/bzip2"
remove_bundled_lib "third_party/codesighs"
remove_bundled_lib "third_party/cros"
diff --git a/www-client/chromium/chromium-8.0.552.23.ebuild b/www-client/chromium/chromium-8.0.552.28.ebuild
index a49cc14fc3cb..825f30032715 100644
--- a/www-client/chromium/chromium-8.0.552.23.ebuild
+++ b/www-client/chromium/chromium-8.0.552.28.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-8.0.552.23.ebuild,v 1.2 2010/10/31 20:47:30 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-8.0.552.28.ebuild,v 1.1 2010/11/04 20:58:33 phajdan.jr Exp $
EAPI="2"
@@ -31,7 +31,7 @@ RDEPEND="app-arch/bzip2
media-libs/jpeg:0
media-libs/libpng
>=media-video/ffmpeg-0.6_p25423[threads]
- cups? ( >=net-print/cups-1.4.4 )
+ cups? ( >=net-print/cups-1.3.11 )
sys-libs/zlib
>=x11-libs/gtk+-2.14.7
x11-libs/libXScrnSaver"
@@ -77,6 +77,9 @@ src_prepare() {
# Enable optional support for gecko-mediaplayer.
epatch "${FILESDIR}"/${PN}-gecko-mediaplayer-r0.patch
+ # Backport a fix for bug #343971.
+ epatch "${FILESDIR}"/${PN}-locale-glib-r1.patch
+
remove_bundled_lib "third_party/bzip2"
remove_bundled_lib "third_party/codesighs"
remove_bundled_lib "third_party/icu"
diff --git a/www-client/chromium/chromium-9.0.570.0.ebuild b/www-client/chromium/chromium-9.0.570.0.ebuild
index 0fd1ca813f45..c2ed9a19c9bf 100644
--- a/www-client/chromium/chromium-9.0.570.0.ebuild
+++ b/www-client/chromium/chromium-9.0.570.0.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9.0.570.0.ebuild,v 1.2 2010/11/03 17:56:06 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9.0.570.0.ebuild,v 1.3 2010/11/04 20:58:33 phajdan.jr Exp $
EAPI="2"
@@ -31,7 +31,7 @@ RDEPEND="app-arch/bzip2
media-libs/jpeg:0
media-libs/libpng
>=media-video/ffmpeg-0.6_p25423[threads]
- cups? ( >=net-print/cups-1.4.4 )
+ cups? ( >=net-print/cups-1.3.11 )
sys-libs/zlib
>=x11-libs/gtk+-2.14.7
x11-libs/libXScrnSaver"
diff --git a/www-client/chromium/chromium-9999.ebuild b/www-client/chromium/chromium-9999.ebuild
index 175c96a0fd26..3800d0ffa0cb 100644
--- a/www-client/chromium/chromium-9999.ebuild
+++ b/www-client/chromium/chromium-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9999.ebuild,v 1.100 2010/11/03 17:56:06 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9999.ebuild,v 1.101 2010/11/04 20:58:33 phajdan.jr Exp $
EAPI="2"
@@ -33,7 +33,7 @@ RDEPEND="app-arch/bzip2
media-libs/jpeg:0
media-libs/libpng
>=media-video/ffmpeg-0.6_p25423[threads]
- cups? ( >=net-print/cups-1.4.4 )
+ cups? ( >=net-print/cups-1.3.11 )
sys-libs/zlib
>=x11-libs/gtk+-2.14.7
x11-libs/libXScrnSaver"
diff --git a/www-client/chromium/files/chromium-locale-glib-r0.patch b/www-client/chromium/files/chromium-locale-glib-r0.patch
new file mode 100644
index 000000000000..eb9bc7dc7312
--- /dev/null
+++ b/www-client/chromium/files/chromium-locale-glib-r0.patch
@@ -0,0 +1,415 @@
+Index: app/l10n_util.cc
+===================================================================
+--- app/l10n_util.cc (revision 63359)
++++ app/l10n_util.cc (working copy)
+@@ -4,6 +4,10 @@
+
+ #include "app/l10n_util.h"
+
++#if defined(TOOLKIT_USES_GTK)
++#include <glib/gutils.h>
++#endif
++
+ #include <cstdlib>
+
+ #include "app/app_paths.h"
+@@ -384,43 +335,71 @@
+ namespace l10n_util {
+
+ std::string GetApplicationLocale(const std::string& pref_locale) {
+-#if !defined(OS_MACOSX)
++#if defined(OS_MACOSX)
++
++ // Use any override (Cocoa for the browser), otherwise use the preference
++ // passed to the function.
++ std::string app_locale = l10n_util::GetLocaleOverride();
++ if (app_locale.empty())
++ app_locale = pref_locale;
++
++ // The above should handle all of the cases Chrome normally hits, but for some
++ // unit tests, we need something to fall back too.
++ if (app_locale.empty())
++ app_locale = "en-US";
++
++ // Windows/Linux call SetICUDefaultLocale after determining the actual locale
++ // with CheckAndResolveLocal to make ICU APIs work in that locale.
++ // Mac doesn't use a locale directory tree of resources (it uses Mac style
++ // resources), so mirror the Windows/Linux behavior of calling
++ // SetICUDefaultLocale.
++ base::i18n::SetICUDefaultLocale(app_locale);
++ return app_locale;
++
++#else
++
+ FilePath locale_path;
+ PathService::Get(app::DIR_LOCALES, &locale_path);
+ std::string resolved_locale;
+ std::vector<std::string> candidates;
+- const std::string system_locale = GetSystemLocale();
+
+ // We only use --lang and the app pref on Windows. On Linux, we only
+ // look at the LC_*/LANG environment variables. We do, however, pass --lang
+ // to renderer and plugin processes so they know what language the parent
+ // process decided to use.
++
+ #if defined(OS_WIN)
++
+ // First, try the preference value.
+ if (!pref_locale.empty())
+ candidates.push_back(pref_locale);
+
+ // Next, try the system locale.
+- candidates.push_back(system_locale);
++ candidates.push_back(base::i18n::GetConfiguredLocale());
+
+ #elif defined(OS_CHROMEOS)
++
+ // On ChromeOS, use the application locale preference.
+ if (!pref_locale.empty())
+ candidates.push_back(pref_locale);
+
+-#elif defined(OS_POSIX)
+- // On POSIX, we also check LANGUAGE environment variable, which is supported
+- // by gettext to specify a priority list of prefered languages.
+- const char* env_language = ::getenv("LANGUAGE");
+- if (env_language)
+- SplitAndNormalizeLanguageList(env_language, &candidates);
++#elif defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
+
+- // Only fallback to the system locale if LANGUAGE is not specified.
+- // We emulate gettext's behavior here, which ignores LANG/LC_MESSAGES/LC_ALL
+- // when LANGUAGE is specified. If no language specified in LANGUAGE is valid,
+- // then just fallback to the locale based on LC_ALL/LANG.
+- if (candidates.empty())
+- candidates.push_back(system_locale);
++ // GLib implements correct environment variable parsing with
++ // the precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG.
++ // We used to use our custom parsing code along with ICU for this purpose.
++ // If we have a port that does not depend on GTK, we have to
++ // restore our custom code for that port.
++ const char* const* languages = g_get_language_names();
++ DCHECK(languages); // A valid pointer is guaranteed.
++ DCHECK(*languages); // At least one entry, "C", is guaranteed.
++
++ for (; *languages != NULL; ++languages) {
++ candidates.push_back(base::i18n::GetCanonicalLocale(*languages));
++ }
++
++#else
++#error Unsupported platform, see build/build_config.h
+ #endif
+
+ std::vector<std::string>::const_iterator i = candidates.begin();
+@@ -443,27 +422,7 @@
+
+ return std::string();
+
+-#else // !defined(OS_MACOSX)
+-
+- // Use any override (Cocoa for the browser), otherwise use the preference
+- // passed to the function.
+- std::string app_locale = l10n_util::GetLocaleOverride();
+- if (app_locale.empty())
+- app_locale = pref_locale;
+-
+- // The above should handle all of the cases Chrome normally hits, but for some
+- // unit tests, we need something to fall back too.
+- if (app_locale.empty())
+- app_locale = "en-US";
+-
+- // Windows/Linux call SetICUDefaultLocale after determining the actual locale
+- // with CheckAndResolveLocal to make ICU APIs work in that locale.
+- // Mac doesn't use a locale directory tree of resources (it uses Mac style
+- // resources), so mirror the Windows/Linux behavior of calling
+- // SetICUDefaultLocale.
+- base::i18n::SetICUDefaultLocale(app_locale);
+- return app_locale;
+-#endif // !defined(OS_MACOSX)
++#endif
+ }
+
+ string16 GetDisplayNameForLocale(const std::string& locale,
+Index: app/l10n_util_unittest.cc
+===================================================================
+--- app/l10n_util_unittest.cc (revision 63359)
++++ app/l10n_util_unittest.cc (working copy)
+@@ -100,7 +100,17 @@
+ // The meaning of that API, on the Mac, is "the locale used by Cocoa's main
+ // nib file", which clearly can't be stubbed by a test app that doesn't use
+ // Cocoa.
++
++void SetDefaultLocaleForTest(const std::string& tag, base::Environment* env) {
++#if defined(OS_POSIX) && !defined(OS_CHROMEOS)
++ env->SetVar("LANGUAGE", tag);
++#else
++ SetICUDefaultLocale(tag);
++#endif
++}
++
+ TEST_F(L10nUtilTest, GetAppLocale) {
++ scoped_ptr<base::Environment> env;
+ // Use a temporary locale dir so we don't have to actually build the locale
+ // dlls for this test.
+ FilePath orig_locale_dir;
+@@ -140,7 +150,7 @@
+ icu::Locale locale = icu::Locale::getDefault();
+
+ #if defined(OS_POSIX) && !defined(OS_CHROMEOS)
+- scoped_ptr<base::Environment> env(base::Environment::Create());
++ env.reset(base::Environment::Create());
+
+ // Test the support of LANGUAGE environment variable.
+ SetICUDefaultLocale("en-US");
+@@ -163,15 +173,25 @@
+ env->SetVar("LANGUAGE", "/fr:zh_CN");
+ EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(""));
+
+- // Make sure the follow tests won't be affected by LANGUAGE environment
+- // variable.
++ // Test prioritization of the different environment variables.
++ env->SetVar("LANGUAGE", "fr");
++ env->SetVar("LC_ALL", "es");
++ env->SetVar("LC_MESSAGES", "he");
++ env->SetVar("LANG", "nb");
++ EXPECT_EQ("fr", l10n_util::GetApplicationLocale(""));
+ env->UnSetVar("LANGUAGE");
++ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
++ env->UnSetVar("LC_ALL");
++ EXPECT_EQ("he", l10n_util::GetApplicationLocale(""));
++ env->UnSetVar("LC_MESSAGES");
++ EXPECT_EQ("nb", l10n_util::GetApplicationLocale(""));
++ env->UnSetVar("LANG");
+ #endif // defined(OS_POSIX) && !defined(OS_CHROMEOS)
+
+- SetICUDefaultLocale("en-US");
++ SetDefaultLocaleForTest("en-US", env.get());
+ EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("xx");
++ SetDefaultLocaleForTest("xx", env.get());
+ EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(""));
+
+ #if defined(OS_CHROMEOS)
+@@ -184,31 +204,31 @@
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale("en-GB"));
+
+ #else // defined(OS_CHROMEOS)
+- SetICUDefaultLocale("en-GB");
++ SetDefaultLocaleForTest("en-GB", env.get());
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("fr-CA");
++ SetDefaultLocaleForTest("fr-CA", env.get());
+ EXPECT_EQ("fr", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es-MX");
++ SetDefaultLocaleForTest("es-MX", env.get());
+ EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es-AR");
++ SetDefaultLocaleForTest("es-AR", env.get());
+ EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es-ES");
++ SetDefaultLocaleForTest("es-ES", env.get());
+ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es");
++ SetDefaultLocaleForTest("es", env.get());
+ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("zh-HK");
++ SetDefaultLocaleForTest("zh-HK", env.get());
+ EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("zh-MK");
++ SetDefaultLocaleForTest("zh-MK", env.get());
+ EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("zh-SG");
++ SetDefaultLocaleForTest("zh-SG", env.get());
+ EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(""));
+ #endif // defined (OS_CHROMEOS)
+
+Index: base/i18n/rtl.cc
+===================================================================
+--- base/i18n/rtl.cc (revision 63359)
++++ base/i18n/rtl.cc (working copy)
+@@ -18,26 +18,58 @@
+ #include <gtk/gtk.h>
+ #endif
+
++namespace {
++
++// Extract language and country, ignore keywords, concatenate using dash.
++std::string GetLocaleString(const icu::Locale& locale) {
++ const char* language = locale.getLanguage();
++ const char* country = locale.getCountry();
++
++ std::string result =
++ (language != NULL && *language != '\0') ? language : "und";
++
++ if (country != NULL && *country != '\0') {
++ result += '-';
++ result += country;
++ }
++
++ return result;
++}
++
++} // namespace
++
+ namespace base {
+ namespace i18n {
+
+ // Represents the locale-specific ICU text direction.
+ static TextDirection g_icu_text_direction = UNKNOWN_DIRECTION;
+
++#if defined(OS_WIN)
+ void GetLanguageAndRegionFromOS(std::string* lang, std::string* region) {
+ // Later we may have to change this to be OS-dependent so that
+ // it's not affected by ICU's default locale. It's all right
+ // to do this way because SetICUDefaultLocale is internal
+ // to this file and we know that it's not yet called when this function
+ // is called.
+- icu::Locale locale = icu::Locale::getDefault();
++ const icu::Locale& locale = icu::Locale::getDefault();
+ const char* language = locale.getLanguage();
+ const char* country = locale.getCountry();
+ DCHECK(language);
+ *lang = language;
+ *region = country;
+ }
++#endif
+
++// Convert the ICU default locale to a string.
++std::string GetConfiguredLocale() {
++ return GetLocaleString(icu::Locale::getDefault());
++}
++
++// Convert the ICU canonicalized locale to a string.
++std::string GetCanonicalLocale(const char* locale) {
++ return GetLocaleString(icu::Locale::createCanonical(locale));
++}
++
+ // Convert Chrome locale name to ICU locale name
+ std::string ICULocaleName(const std::string& locale_string) {
+ // If not Spanish, just return it.
+@@ -50,13 +82,14 @@
+ // locale. If it's es-RR other than es-ES, map to es-RR. Otherwise, map
+ // to es-MX (the most populous in Spanish-speaking Latin America).
+ if (LowerCaseEqualsASCII(locale_string, "es-419")) {
+- std::string lang, region;
+- GetLanguageAndRegionFromOS(&lang, &region);
+- if (LowerCaseEqualsASCII(lang, "es") &&
+- !LowerCaseEqualsASCII(region, "es")) {
+- lang.append("-");
+- lang.append(region);
+- return lang;
++ const icu::Locale& locale = icu::Locale::getDefault();
++ std::string language = locale.getLanguage();
++ const char* country = locale.getCountry();
++ if (LowerCaseEqualsASCII(language, "es") &&
++ !LowerCaseEqualsASCII(country, "es")) {
++ language += '-';
++ language += country;
++ return language;
+ }
+ return "es-MX";
+ }
+Index: base/i18n/rtl.h
+===================================================================
+--- base/i18n/rtl.h (revision 63359)
++++ base/i18n/rtl.h (working copy)
+@@ -29,9 +29,19 @@
+ LEFT_TO_RIGHT,
+ };
+
+-// Get language and region from the OS.
++#if defined(OS_WIN)
++// Get language and region from the OS. Used by Chrome Frame.
+ void GetLanguageAndRegionFromOS(std::string* lang, std::string* region);
++#endif
+
++// Get the locale that the currently running process has been configured to use.
++// The return value is of the form language[-country] (e.g., en-US) where the
++// language is the 2 or 3 letter code from ISO-639.
++std::string GetConfiguredLocale();
++
++// Canonicalize a string (eg. a POSIX locale string) to a Chrome locale name.
++std::string GetCanonicalLocale(const char* locale);
++
+ // Sets the default locale of ICU.
+ // Once the application locale of Chrome in GetApplicationLocale is determined,
+ // the default locale of ICU need to be changed to match the application locale
+@@ -136,7 +146,7 @@
+ // string is wrapped with LRE (Left-To-Right Embedding) and PDF (Pop
+ // Directional Formatting) marks and returned. In LTR locale, the string itself
+ // is returned.
+-string16 GetDisplayStringInLTRDirectionality(const string16& text)
++string16 GetDisplayStringInLTRDirectionality(const string16& text)
+ WARN_UNUSED_RESULT;
+
+ // Strip the beginning (U+202A..U+202B, U+202D..U+202E) and/or ending (U+202C)
+--- app/l10n_util.cc.orig 2010-11-04 13:19:45.000000000 +0100
++++ app/l10n_util.cc 2010-11-04 13:20:46.000000000 +0100
+@@ -313,59 +313,6 @@
+ return false;
+ }
+
+-// Get the locale of the operating system. The return value is of the form
+-// language[-country] (e.g., en-US) where the language is the 2 letter code from
+-// ISO-639.
+-std::string GetSystemLocale() {
+- std::string language, region;
+- base::i18n::GetLanguageAndRegionFromOS(&language, &region);
+- std::string ret;
+- if (!language.empty())
+- ret.append(language);
+- if (!region.empty()) {
+- ret.append("-");
+- ret.append(region);
+- }
+- return ret;
+-}
+-
+-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+-// Split and normalize the language list specified by LANGUAGE environment.
+-// LANGUAGE environment specifies a priority list of user prefered locales for
+-// application UI messages. Locales are separated by ':' character. The format
+-// of a locale is: language[_territory[.codeset]][@modifier]
+-//
+-// This function splits the language list and normalizes each locale into
+-// language[-territory] format, eg. fr, zh-CN, etc.
+-void SplitAndNormalizeLanguageList(const std::string& env_language,
+- std::vector<std::string>* result) {
+- std::vector<std::string> langs;
+- SplitString(env_language, ':', &langs);
+- std::vector<std::string>::iterator i = langs.begin();
+- for (; i != langs.end(); ++i) {
+- size_t end_pos = i->find_first_of(".@");
+- // Erase encoding and modifier part.
+- if (end_pos != std::string::npos)
+- i->erase(end_pos);
+-
+- if (!i->empty()) {
+- std::string locale;
+- size_t sep = i->find_first_of("_-");
+- if (sep != std::string::npos) {
+- // language part is always in lower case.
+- locale = StringToLowerASCII(i->substr(0, sep));
+- locale.append("-");
+- // territory part is always in upper case.
+- locale.append(StringToUpperASCII(i->substr(sep + 1)));
+- } else {
+- locale = StringToLowerASCII(*i);
+- }
+- result->push_back(locale);
+- }
+- }
+-}
+-#endif
+-
+ // On Linux, the text layout engine Pango determines paragraph directionality
+ // by looking at the first strongly-directional character in the text. This
+ // means text such as "Google Chrome foo bar..." will be layed out LTR even
diff --git a/www-client/chromium/files/chromium-locale-glib-r1.patch b/www-client/chromium/files/chromium-locale-glib-r1.patch
new file mode 100644
index 000000000000..1c9c72608680
--- /dev/null
+++ b/www-client/chromium/files/chromium-locale-glib-r1.patch
@@ -0,0 +1,415 @@
+Index: app/l10n_util.cc
+===================================================================
+--- app/l10n_util.cc (revision 63359)
++++ app/l10n_util.cc (working copy)
+@@ -4,6 +4,10 @@
+
+ #include "app/l10n_util.h"
+
++#if defined(TOOLKIT_USES_GTK)
++#include <glib/gutils.h>
++#endif
++
+ #include <cstdlib>
+
+ #include "app/app_paths.h"
+@@ -384,43 +335,71 @@
+ namespace l10n_util {
+
+ std::string GetApplicationLocale(const std::string& pref_locale) {
+-#if !defined(OS_MACOSX)
++#if defined(OS_MACOSX)
++
++ // Use any override (Cocoa for the browser), otherwise use the preference
++ // passed to the function.
++ std::string app_locale = l10n_util::GetLocaleOverride();
++ if (app_locale.empty())
++ app_locale = pref_locale;
++
++ // The above should handle all of the cases Chrome normally hits, but for some
++ // unit tests, we need something to fall back too.
++ if (app_locale.empty())
++ app_locale = "en-US";
++
++ // Windows/Linux call SetICUDefaultLocale after determining the actual locale
++ // with CheckAndResolveLocal to make ICU APIs work in that locale.
++ // Mac doesn't use a locale directory tree of resources (it uses Mac style
++ // resources), so mirror the Windows/Linux behavior of calling
++ // SetICUDefaultLocale.
++ base::i18n::SetICUDefaultLocale(app_locale);
++ return app_locale;
++
++#else
++
+ FilePath locale_path;
+ PathService::Get(app::DIR_LOCALES, &locale_path);
+ std::string resolved_locale;
+ std::vector<std::string> candidates;
+- const std::string system_locale = GetSystemLocale();
+
+ // We only use --lang and the app pref on Windows. On Linux, we only
+ // look at the LC_*/LANG environment variables. We do, however, pass --lang
+ // to renderer and plugin processes so they know what language the parent
+ // process decided to use.
++
+ #if defined(OS_WIN)
++
+ // First, try the preference value.
+ if (!pref_locale.empty())
+ candidates.push_back(pref_locale);
+
+ // Next, try the system locale.
+- candidates.push_back(system_locale);
++ candidates.push_back(base::i18n::GetConfiguredLocale());
+
+ #elif defined(OS_CHROMEOS)
++
+ // On ChromeOS, use the application locale preference.
+ if (!pref_locale.empty())
+ candidates.push_back(pref_locale);
+
+-#elif defined(OS_POSIX)
+- // On POSIX, we also check LANGUAGE environment variable, which is supported
+- // by gettext to specify a priority list of prefered languages.
+- const char* env_language = ::getenv("LANGUAGE");
+- if (env_language)
+- SplitAndNormalizeLanguageList(env_language, &candidates);
++#elif defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
+
+- // Only fallback to the system locale if LANGUAGE is not specified.
+- // We emulate gettext's behavior here, which ignores LANG/LC_MESSAGES/LC_ALL
+- // when LANGUAGE is specified. If no language specified in LANGUAGE is valid,
+- // then just fallback to the locale based on LC_ALL/LANG.
+- if (candidates.empty())
+- candidates.push_back(system_locale);
++ // GLib implements correct environment variable parsing with
++ // the precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG.
++ // We used to use our custom parsing code along with ICU for this purpose.
++ // If we have a port that does not depend on GTK, we have to
++ // restore our custom code for that port.
++ const char* const* languages = g_get_language_names();
++ DCHECK(languages); // A valid pointer is guaranteed.
++ DCHECK(*languages); // At least one entry, "C", is guaranteed.
++
++ for (; *languages != NULL; ++languages) {
++ candidates.push_back(base::i18n::GetCanonicalLocale(*languages));
++ }
++
++#else
++#error Unsupported platform, see build/build_config.h
+ #endif
+
+ std::vector<std::string>::const_iterator i = candidates.begin();
+@@ -443,27 +422,7 @@
+
+ return std::string();
+
+-#else // !defined(OS_MACOSX)
+-
+- // Use any override (Cocoa for the browser), otherwise use the preference
+- // passed to the function.
+- std::string app_locale = l10n_util::GetLocaleOverride();
+- if (app_locale.empty())
+- app_locale = pref_locale;
+-
+- // The above should handle all of the cases Chrome normally hits, but for some
+- // unit tests, we need something to fall back too.
+- if (app_locale.empty())
+- app_locale = "en-US";
+-
+- // Windows/Linux call SetICUDefaultLocale after determining the actual locale
+- // with CheckAndResolveLocal to make ICU APIs work in that locale.
+- // Mac doesn't use a locale directory tree of resources (it uses Mac style
+- // resources), so mirror the Windows/Linux behavior of calling
+- // SetICUDefaultLocale.
+- base::i18n::SetICUDefaultLocale(app_locale);
+- return app_locale;
+-#endif // !defined(OS_MACOSX)
++#endif
+ }
+
+ string16 GetDisplayNameForLocale(const std::string& locale,
+Index: app/l10n_util_unittest.cc
+===================================================================
+--- app/l10n_util_unittest.cc (revision 63359)
++++ app/l10n_util_unittest.cc (working copy)
+@@ -100,7 +100,17 @@
+ // The meaning of that API, on the Mac, is "the locale used by Cocoa's main
+ // nib file", which clearly can't be stubbed by a test app that doesn't use
+ // Cocoa.
++
++void SetDefaultLocaleForTest(const std::string& tag, base::Environment* env) {
++#if defined(OS_POSIX) && !defined(OS_CHROMEOS)
++ env->SetVar("LANGUAGE", tag);
++#else
++ SetICUDefaultLocale(tag);
++#endif
++}
++
+ TEST_F(L10nUtilTest, GetAppLocale) {
++ scoped_ptr<base::Environment> env;
+ // Use a temporary locale dir so we don't have to actually build the locale
+ // dlls for this test.
+ FilePath orig_locale_dir;
+@@ -140,7 +150,7 @@
+ icu::Locale locale = icu::Locale::getDefault();
+
+ #if defined(OS_POSIX) && !defined(OS_CHROMEOS)
+- scoped_ptr<base::Environment> env(base::Environment::Create());
++ env.reset(base::Environment::Create());
+
+ // Test the support of LANGUAGE environment variable.
+ SetICUDefaultLocale("en-US");
+@@ -163,15 +173,25 @@
+ env->SetVar("LANGUAGE", "/fr:zh_CN");
+ EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(""));
+
+- // Make sure the follow tests won't be affected by LANGUAGE environment
+- // variable.
++ // Test prioritization of the different environment variables.
++ env->SetVar("LANGUAGE", "fr");
++ env->SetVar("LC_ALL", "es");
++ env->SetVar("LC_MESSAGES", "he");
++ env->SetVar("LANG", "nb");
++ EXPECT_EQ("fr", l10n_util::GetApplicationLocale(""));
+ env->UnSetVar("LANGUAGE");
++ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
++ env->UnSetVar("LC_ALL");
++ EXPECT_EQ("he", l10n_util::GetApplicationLocale(""));
++ env->UnSetVar("LC_MESSAGES");
++ EXPECT_EQ("nb", l10n_util::GetApplicationLocale(""));
++ env->UnSetVar("LANG");
+ #endif // defined(OS_POSIX) && !defined(OS_CHROMEOS)
+
+- SetICUDefaultLocale("en-US");
++ SetDefaultLocaleForTest("en-US", env.get());
+ EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("xx");
++ SetDefaultLocaleForTest("xx", env.get());
+ EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(""));
+
+ #if defined(OS_CHROMEOS)
+@@ -184,31 +204,31 @@
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale("en-GB"));
+
+ #else // defined(OS_CHROMEOS)
+- SetICUDefaultLocale("en-GB");
++ SetDefaultLocaleForTest("en-GB", env.get());
+ EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("fr-CA");
++ SetDefaultLocaleForTest("fr-CA", env.get());
+ EXPECT_EQ("fr", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es-MX");
++ SetDefaultLocaleForTest("es-MX", env.get());
+ EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es-AR");
++ SetDefaultLocaleForTest("es-AR", env.get());
+ EXPECT_EQ("es-419", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es-ES");
++ SetDefaultLocaleForTest("es-ES", env.get());
+ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("es");
++ SetDefaultLocaleForTest("es", env.get());
+ EXPECT_EQ("es", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("zh-HK");
++ SetDefaultLocaleForTest("zh-HK", env.get());
+ EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("zh-MK");
++ SetDefaultLocaleForTest("zh-MK", env.get());
+ EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(""));
+
+- SetICUDefaultLocale("zh-SG");
++ SetDefaultLocaleForTest("zh-SG", env.get());
+ EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(""));
+ #endif // defined (OS_CHROMEOS)
+
+Index: base/i18n/rtl.cc
+===================================================================
+--- base/i18n/rtl.cc (revision 63359)
++++ base/i18n/rtl.cc (working copy)
+@@ -18,26 +18,58 @@
+ #include <gtk/gtk.h>
+ #endif
+
++namespace {
++
++// Extract language and country, ignore keywords, concatenate using dash.
++std::string GetLocaleString(const icu::Locale& locale) {
++ const char* language = locale.getLanguage();
++ const char* country = locale.getCountry();
++
++ std::string result =
++ (language != NULL && *language != '\0') ? language : "und";
++
++ if (country != NULL && *country != '\0') {
++ result += '-';
++ result += country;
++ }
++
++ return result;
++}
++
++} // namespace
++
+ namespace base {
+ namespace i18n {
+
+ // Represents the locale-specific ICU text direction.
+ static TextDirection g_icu_text_direction = UNKNOWN_DIRECTION;
+
++#if defined(OS_WIN)
+ void GetLanguageAndRegionFromOS(std::string* lang, std::string* region) {
+ // Later we may have to change this to be OS-dependent so that
+ // it's not affected by ICU's default locale. It's all right
+ // to do this way because SetICUDefaultLocale is internal
+ // to this file and we know that it's not yet called when this function
+ // is called.
+- icu::Locale locale = icu::Locale::getDefault();
++ const icu::Locale& locale = icu::Locale::getDefault();
+ const char* language = locale.getLanguage();
+ const char* country = locale.getCountry();
+ DCHECK(language);
+ *lang = language;
+ *region = country;
+ }
++#endif
+
++// Convert the ICU default locale to a string.
++std::string GetConfiguredLocale() {
++ return GetLocaleString(icu::Locale::getDefault());
++}
++
++// Convert the ICU canonicalized locale to a string.
++std::string GetCanonicalLocale(const char* locale) {
++ return GetLocaleString(icu::Locale::createCanonical(locale));
++}
++
+ // Convert Chrome locale name to ICU locale name
+ std::string ICULocaleName(const std::string& locale_string) {
+ // If not Spanish, just return it.
+@@ -50,13 +82,14 @@
+ // locale. If it's es-RR other than es-ES, map to es-RR. Otherwise, map
+ // to es-MX (the most populous in Spanish-speaking Latin America).
+ if (LowerCaseEqualsASCII(locale_string, "es-419")) {
+- std::string lang, region;
+- GetLanguageAndRegionFromOS(&lang, &region);
+- if (LowerCaseEqualsASCII(lang, "es") &&
+- !LowerCaseEqualsASCII(region, "es")) {
+- lang.append("-");
+- lang.append(region);
+- return lang;
++ const icu::Locale& locale = icu::Locale::getDefault();
++ std::string language = locale.getLanguage();
++ const char* country = locale.getCountry();
++ if (LowerCaseEqualsASCII(language, "es") &&
++ !LowerCaseEqualsASCII(country, "es")) {
++ language += '-';
++ language += country;
++ return language;
+ }
+ return "es-MX";
+ }
+Index: base/i18n/rtl.h
+===================================================================
+--- base/i18n/rtl.h (revision 63359)
++++ base/i18n/rtl.h (working copy)
+@@ -29,9 +29,19 @@
+ LEFT_TO_RIGHT,
+ };
+
+-// Get language and region from the OS.
++#if defined(OS_WIN)
++// Get language and region from the OS. Used by Chrome Frame.
+ void GetLanguageAndRegionFromOS(std::string* lang, std::string* region);
++#endif
+
++// Get the locale that the currently running process has been configured to use.
++// The return value is of the form language[-country] (e.g., en-US) where the
++// language is the 2 or 3 letter code from ISO-639.
++std::string GetConfiguredLocale();
++
++// Canonicalize a string (eg. a POSIX locale string) to a Chrome locale name.
++std::string GetCanonicalLocale(const char* locale);
++
+ // Sets the default locale of ICU.
+ // Once the application locale of Chrome in GetApplicationLocale is determined,
+ // the default locale of ICU need to be changed to match the application locale
+@@ -136,7 +146,7 @@
+ // string is wrapped with LRE (Left-To-Right Embedding) and PDF (Pop
+ // Directional Formatting) marks and returned. In LTR locale, the string itself
+ // is returned.
+-string16 GetDisplayStringInLTRDirectionality(const string16& text)
++string16 GetDisplayStringInLTRDirectionality(const string16& text)
+ WARN_UNUSED_RESULT;
+
+ // Strip the beginning (U+202A..U+202B, U+202D..U+202E) and/or ending (U+202C)
+--- app/l10n_util.cc.orig 2010-11-04 19:18:08.000000000 +0100
++++ app/l10n_util.cc 2010-11-04 19:18:41.000000000 +0100
+@@ -314,59 +314,6 @@
+
+ return false;
+ }
+-
+-// Get the locale of the operating system. The return value is of the form
+-// language[-country] (e.g., en-US) where the language is the 2 letter code from
+-// ISO-639.
+-std::string GetSystemLocale() {
+- std::string language, region;
+- base::i18n::GetLanguageAndRegionFromOS(&language, &region);
+- std::string ret;
+- if (!language.empty())
+- ret.append(language);
+- if (!region.empty()) {
+- ret.append("-");
+- ret.append(region);
+- }
+- return ret;
+-}
+-#endif
+-
+-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+-// Split and normalize the language list specified by LANGUAGE environment.
+-// LANGUAGE environment specifies a priority list of user prefered locales for
+-// application UI messages. Locales are separated by ':' character. The format
+-// of a locale is: language[_territory[.codeset]][@modifier]
+-//
+-// This function splits the language list and normalizes each locale into
+-// language[-territory] format, eg. fr, zh-CN, etc.
+-void SplitAndNormalizeLanguageList(const std::string& env_language,
+- std::vector<std::string>* result) {
+- std::vector<std::string> langs;
+- SplitString(env_language, ':', &langs);
+- std::vector<std::string>::iterator i = langs.begin();
+- for (; i != langs.end(); ++i) {
+- size_t end_pos = i->find_first_of(".@");
+- // Erase encoding and modifier part.
+- if (end_pos != std::string::npos)
+- i->erase(end_pos);
+-
+- if (!i->empty()) {
+- std::string locale;
+- size_t sep = i->find_first_of("_-");
+- if (sep != std::string::npos) {
+- // language part is always in lower case.
+- locale = StringToLowerASCII(i->substr(0, sep));
+- locale.append("-");
+- // territory part is always in upper case.
+- locale.append(StringToUpperASCII(i->substr(sep + 1)));
+- } else {
+- locale = StringToLowerASCII(*i);
+- }
+- result->push_back(locale);
+- }
+- }
+-}
+ #endif
+
+ // On Linux, the text layout engine Pango determines paragraph directionality