Title: [211871] trunk/Source/WebCore
Revision
211871
Author
[email protected]
Date
2017-02-08 08:20:19 -0800 (Wed, 08 Feb 2017)

Log Message

[GTK] Fix translatable form validation messages
https://bugs.webkit.org/show_bug.cgi?id=167984

Reviewed by Michael Catanzaro.

Most of them are just wrong. Use the same mesages than mac, which also makes some tests pass.

Fixes: fast/forms/validation-message-maxLength.html
       fast/forms/validationMessage.html

* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::validationMessageValueMissingText):
(WebCore::validationMessageValueMissingForCheckboxText):
(WebCore::validationMessageValueMissingForFileText):
(WebCore::validationMessageValueMissingForMultipleFileText):
(WebCore::validationMessageValueMissingForRadioText):
(WebCore::validationMessageValueMissingForSelectText):
(WebCore::validationMessageTypeMismatchText):
(WebCore::validationMessageTypeMismatchForEmailText):
(WebCore::validationMessageTypeMismatchForMultipleEmailText):
(WebCore::validationMessageTypeMismatchForURLText):
(WebCore::validationMessagePatternMismatchText):
(WebCore::validationMessageTooShortText):
(WebCore::validationMessageTooLongText):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::validationMessageStepMismatchText):
(WebCore::validationMessageBadInputForNumberText):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (211870 => 211871)


--- trunk/Source/WebCore/ChangeLog	2017-02-08 15:39:38 UTC (rev 211870)
+++ trunk/Source/WebCore/ChangeLog	2017-02-08 16:20:19 UTC (rev 211871)
@@ -1,3 +1,34 @@
+2017-02-08  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Fix translatable form validation messages
+        https://bugs.webkit.org/show_bug.cgi?id=167984
+
+        Reviewed by Michael Catanzaro.
+
+        Most of them are just wrong. Use the same mesages than mac, which also makes some tests pass.
+
+        Fixes: fast/forms/validation-message-maxLength.html
+               fast/forms/validationMessage.html
+
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::validationMessageValueMissingText):
+        (WebCore::validationMessageValueMissingForCheckboxText):
+        (WebCore::validationMessageValueMissingForFileText):
+        (WebCore::validationMessageValueMissingForMultipleFileText):
+        (WebCore::validationMessageValueMissingForRadioText):
+        (WebCore::validationMessageValueMissingForSelectText):
+        (WebCore::validationMessageTypeMismatchText):
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessagePatternMismatchText):
+        (WebCore::validationMessageTooShortText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+        (WebCore::validationMessageBadInputForNumberText):
+
 2017-02-08  Chris Dumez  <[email protected]>
 
         Add support for enhanced privacy diagnostic logging

Modified: trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp (211870 => 211871)


--- trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2017-02-08 15:39:38 UTC (rev 211870)
+++ trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2017-02-08 16:20:19 UTC (rev 211871)
@@ -756,93 +756,93 @@
 
 String validationMessageValueMissingText()
 {
-    return String::fromUTF8(_("value missing"));
+    return String::fromUTF8(_("Fill out this field"));
 }
 
 String validationMessageValueMissingForCheckboxText()
 {
-    notImplemented();
-    return validationMessageValueMissingText();
+    return String::fromUTF8(_("Select this checkbox"));
 }
 
 String validationMessageValueMissingForFileText()
 {
-    notImplemented();
-    return validationMessageValueMissingText();
+    return String::fromUTF8(_("Select a file"));
 }
 
 String validationMessageValueMissingForMultipleFileText()
 {
-    notImplemented();
-    return validationMessageValueMissingText();
+    return validationMessageValueMissingForFileText();
 }
 
 String validationMessageValueMissingForRadioText()
 {
-    notImplemented();
-    return validationMessageValueMissingText();
+    return String::fromUTF8(_("Select one of these options"));
 }
 
 String validationMessageValueMissingForSelectText()
 {
-    notImplemented();
-    return validationMessageValueMissingText();
+    return String::fromUTF8(_("Select an item in the list"));
 }
 
 String validationMessageTypeMismatchText()
 {
-    notImplemented();
-    return String::fromUTF8(_("type mismatch"));
+    return String::fromUTF8(_("Invalid value"));
 }
 
 String validationMessageTypeMismatchForEmailText()
 {
-    notImplemented();
-    return validationMessageTypeMismatchText();
+    return String::fromUTF8(_("Enter an email address"));
 }
 
 String validationMessageTypeMismatchForMultipleEmailText()
 {
-    notImplemented();
-    return validationMessageTypeMismatchText();
+    return validationMessageTypeMismatchForEmailText();
 }
 
 String validationMessageTypeMismatchForURLText()
 {
-    notImplemented();
-    return validationMessageTypeMismatchText();
+    return String::fromUTF8(_("Enter a URL"));
 }
 
 String validationMessagePatternMismatchText()
 {
-    return String::fromUTF8(_("pattern mismatch"));
+    return String::fromUTF8(_("Match the requested format"));
 }
 
-String validationMessageTooShortText(int, int)
+String validationMessageTooShortText(int, int minLength)
 {
-    return String::fromUTF8(_("too short"));
+    GUniquePtr<char> string(g_strdup_printf(ngettext("Use at least one character", "Use at least %d characters", minLength), minLength));
+    return String::fromUTF8(string.get());
 }
 
-String validationMessageTooLongText(int, int)
+String validationMessageTooLongText(int, int maxLength)
 {
-    return String::fromUTF8(_("too long"));
+    GUniquePtr<char> string(g_strdup_printf(ngettext("Use no more than one character", "Use no more than %d characters", maxLength), maxLength));
+    return String::fromUTF8(string.get());
 }
 
-String validationMessageRangeUnderflowText(const String&)
+String validationMessageRangeUnderflowText(const String& minimum)
 {
-    return String::fromUTF8(_("range underflow"));
+    GUniquePtr<char> string(g_strdup_printf(_("Value must be greater than or equal to %s"), minimum.utf8().data()));
+    return String::fromUTF8(string.get());
 }
 
-String validationMessageRangeOverflowText(const String&)
+String validationMessageRangeOverflowText(const String& maximum)
 {
-    return String::fromUTF8(_("range overflow"));
+    GUniquePtr<char> string(g_strdup_printf(_("Value must be less than or equal to %s"), maximum.utf8().data()));
+    return String::fromUTF8(string.get());
 }
 
 String validationMessageStepMismatchText(const String&, const String&)
 {
-    return String::fromUTF8(_("step mismatch"));
+    return String::fromUTF8(_("Enter a valid value"));
 }
 
+String validationMessageBadInputForNumberText()
+{
+    return String::fromUTF8(_("Enter a number"));
+}
+
 String unacceptableTLSCertificate()
 {
     return String::fromUTF8(_("Unacceptable TLS certificate"));
@@ -853,12 +853,6 @@
     return String::fromUTF8(key, strlen(key));
 }
 
-String validationMessageBadInputForNumberText()
-{
-    notImplemented();
-    return validationMessageTypeMismatchText();
-}
-
 #if ENABLE(VIDEO_TRACK)
 String textTrackSubtitlesText()
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to