The only general REST mailing list I know about is this one:
http://tech.groups.yahoo.com/group/rest-discuss/ . I'm not 100% certain
if this question is on-topic for that list, although I suspect it is.
>
> What is the preferred way of doing a Rest interface which is
> localizable. I want consumer of my web service to be able to post in
> localized version of string.
>
> Which among the following is preferable:
> For eg.
> <emotion culture="en-US">Happy</emotion>
> <emotion culture="fr-fr">Foobar</emotion>
I would have a hard look at the xml:lang attribue ([1]). It is used
consistently in good specs where the content of an element is
human-language dependent. It would be better to use an existing
attribute with commonly understood behaviour than to invent your own.
[1] http://www.w3.org/XML/1998/namespace
>
> Or
> <emotion><resource><id>45</id><value>happy</value></resource></
> emotion>
Well, it depends. The second version is less ambiguous, whereas the
first is more human-readable. Problem with the first version is that you
need to design what strings are considered the same for comparison
purposes. For example, are "Happy" and "happy" the same emotion in
en-US? Are "straße" and "strasse" the same for the German section (okay,
emotion="street" is unlikely, but ß->ss and ä->ae, for example, are
common typographical equivalences in that language).
That is, by the way, why select options in HTML forms have a
human-readable string and a (separate) value attribute that is what is
submitted to the server. The attribute doesn't care what language is
used to display the data to the human. It effectively normalises it to
something that the program on the server-side can read.
For that reason, I would go with the second option, but structure it in
a way similar to HTML option elements: have a human readable string --
which can use the xml:lang attribute to specify the language -- and a
value that is what is submitted to the server.
Localisation is really only relevant for display purposes, not for
submission purposes. In other words, it's strongly recommended to use a
normal form for submission (for example, if somebody is submitting a
current value, you might well say it has to be in IEEE format, so using
a period for the decimal separator, even when the "display" value uses a
comma there for the locale in use).
Regards,
Malcolm