[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:45:57 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit f056fcd11f30a2aa5d15caf574e17db551ca18be
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 16 12:47:17 2009 +0000

    2009-10-16  Shu Chang  <Chang.Shu at nokia.com>
    
            Reviewed by Eric Seidel.
    
            Added test case for testing navigator.language.
            https://bugs.webkit.org/show_bug.cgi?id=29653
    
            Different browsers may not return the exact same result.
            Some examples here:
            Safari 4 WinXP: "en-US"
            Safari 4 Mac: "en-us"
            Firefox 3 Mac/WinXP: "en-US"
            Opera 9.64: "en"
            Epiphany 2 GTK: "en"
            Chrome 3 WinXP: "en-US"
    
            The test case checks if the first two letters are "en"
            when system locale is set to "en_US.iso88591".
    
            * fast/js/navigator-language-expected.txt: Added.
            * fast/js/navigator-language.html: Added.
    2009-10-16  Shu Chang  <Chang.Shu at nokia.com>
    
            Reviewed by Eric Seidel.
    
            Default language translation should be determined by locale settings,
            e.g., "en-US".
            https://bugs.webkit.org/show_bug.cgi?id=29653
    
            Test: fast/js/navigator-language.html
    
            * platform/qt/Localizations.cpp:
            (WebCore::defaultLanguage):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49675 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b2ba566..4f37b42 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-16  Shu Chang  <Chang.Shu at nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Added test case for testing navigator.language.
+        https://bugs.webkit.org/show_bug.cgi?id=29653
+ 
+        Different browsers may not return the exact same result.
+        Some examples here:
+        Safari 4 WinXP: "en-US"
+        Safari 4 Mac: "en-us"
+        Firefox 3 Mac/WinXP: "en-US"
+        Opera 9.64: "en"
+        Epiphany 2 GTK: "en"
+        Chrome 3 WinXP: "en-US"
+
+        The test case checks if the first two letters are "en"
+        when system locale is set to "en_US.iso88591".
+
+        * fast/js/navigator-language-expected.txt: Added.
+        * fast/js/navigator-language.html: Added.
+
 2009-10-15  Daniel Bates  <dbates at webkit.org>
 
         No review, rolling out r49644.
diff --git a/LayoutTests/fast/js/navigator-language-expected.txt b/LayoutTests/fast/js/navigator-language-expected.txt
new file mode 100644
index 0000000..d367428
--- /dev/null
+++ b/LayoutTests/fast/js/navigator-language-expected.txt
@@ -0,0 +1,16 @@
+Test for bug 29653: [Qt] Qt-based browser fails to show the right language translation.
+Language tags should follow the specification below:
+2.1.1.  Formatting of Language Tags
+
+   At all times, language tags and their subtags, including private use
+   and extensions, are to be treated as case insensitive: there exist
+   conventions for the capitalization of some of the subtags, but these
+   MUST NOT be taken to carry meaning.
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS navigator.language.substring(0,2) is 'en'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/navigator-language.html b/LayoutTests/fast/js/navigator-language.html
new file mode 100644
index 0000000..4b421af
--- /dev/null
+++ b/LayoutTests/fast/js/navigator-language.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description(
+"<pre>Test for bug 29653: [Qt] Qt-based browser fails to show the right language translation.\n\
+Language tags should follow the specification below:\n\
+2.1.1.  Formatting of Language Tags\n\
+\n\
+   At all times, language tags and their subtags, including private use\n\
+   and extensions, are to be treated as case insensitive: there exist\n\
+   conventions for the capitalization of some of the subtags, but these\n\
+   MUST NOT be taken to carry meaning.</pre>"
+);
+
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.setPOSIXLocale("en_US.iso88591");
+}
+
+shouldBe("navigator.language.substring(0,2)", "'en'");
+
+var successfullyParsed = true;
+</script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5e2815f..0c9a0ad 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-16  Shu Chang  <Chang.Shu at nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Default language translation should be determined by locale settings,
+        e.g., "en-US".
+        https://bugs.webkit.org/show_bug.cgi?id=29653
+
+        Test: fast/js/navigator-language.html
+
+        * platform/qt/Localizations.cpp:
+        (WebCore::defaultLanguage):
+
 2009-10-16  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebCore/platform/qt/Localizations.cpp b/WebCore/platform/qt/Localizations.cpp
index 77cac57..ca3ca9d 100644
--- a/WebCore/platform/qt/Localizations.cpp
+++ b/WebCore/platform/qt/Localizations.cpp
@@ -33,6 +33,7 @@
 #include "PlatformString.h"
 
 #include <QCoreApplication>
+#include <QLocale>
 
 namespace WebCore {
 
@@ -53,7 +54,8 @@ String resetButtonDefaultLabel()
 
 String defaultLanguage()
 {
-    return "en";
+    QLocale locale;
+    return locale.name().replace("_", "-");
 }
 
 String searchableIndexIntroduction()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list