How to deal with localized strings
Hi guys, I'm gonna implement the support to the "validationMessage" HTML5 DOM attribute of form control elements, it shall return a string that describes which validation state the element is in. AFAIK this should be a localized string to be presented to the user: I tought to write a simple: enum ValidationMessage {STD_MSG1, STD_MSG2, etc...} in HTMLFormControlElement to have a simple representation of the standard messages and then leave the localization to the embedder. In order to accomplish this in HTMLFormControlElement::validationMessage() I should return the localized string obtained from the embedder and this is the trouble I went into: how such a thing is usually done in WebKit? I'd appreciate any help you may provide. Thank you. -- Bye, Michelangelo, a future ex-gsocer
On Mon, Aug 24, 2009 at 2:07 PM, Michelangelo De Simone<micdesim@gmail.com> wrote:
In order to accomplish this in HTMLFormControlElement::validationMessage() I should return the localized string obtained from the embedder and this is the trouble I went into: how such a thing is usually done in WebKit?
WebCore/platform/LocalizedStrings.h seems appropriate :) -- Regards, Ryan
2009/8/25 Ryan Leavengood <leavengood@gmail.com>:
WebCore/platform/LocalizedStrings.h seems appropriate :)
Thanks for the tip Ryan; I've been wondering if I have to modify all the LocalizedString<Port> files: I don't want to incidentally brake some port and, in the same time, I must bring the same functionality to the DOM "validationMessage" attribute on all ports (27959). Any illuminating suggestion?:) -- Bye, Michelangelo
On Fri, 2009-08-28 at 17:21 +0200, Michelangelo De Simone wrote:
2009/8/28 Michelangelo De Simone <micdesim@gmail.com>:
Any illuminating suggestion?:)
It's nice to self-answer:) Anyway, there's no need for "illuminating suggestions", returning an empty String on each port seems a good choice.:)
Sorry I am very late =). I got here from the test failure for GTK+. I think a better approach for our port at least would be to have the default, untranslated strings, instead of empty strings. I am going to patch the code to add the expected strings for the test. Thanks, -- Gustavo Noronha Silva <gns@gnome.org> GNOME Project
participants (3)
-
Gustavo Noronha Silva
-
Michelangelo De Simone
-
Ryan Leavengood