summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/Language.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
commit1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch)
tree4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/platform/gtk/Language.cpp
parent9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff)
downloadexternal_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/platform/gtk/Language.cpp')
-rw-r--r--WebCore/platform/gtk/Language.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/WebCore/platform/gtk/Language.cpp b/WebCore/platform/gtk/Language.cpp
index 171cd84..6ae7305 100644
--- a/WebCore/platform/gtk/Language.cpp
+++ b/WebCore/platform/gtk/Language.cpp
@@ -26,6 +26,30 @@
#include <gtk/gtk.h>
#include <pango/pango.h>
+#if !defined(PANGO_VERSION_CHECK)
+// PANGO_VERSION_CHECK() and pango_language_get_default() appeared in 1.5.2
+#include <locale.h>
+
+static gchar *
+_pango_get_lc_ctype (void)
+{
+ return g_strdup (setlocale (LC_CTYPE, NULL));
+}
+
+static PangoLanguage *
+pango_language_get_default (void)
+{
+ static PangoLanguage *result = NULL;
+ if (G_UNLIKELY (!result))
+ {
+ gchar *lang = _pango_get_lc_ctype ();
+ result = pango_language_from_string (lang);
+ g_free (lang);
+ }
+ return result;
+}
+#endif
+
namespace WebCore {
String defaultLanguage()