json localization

3 views
Skip to first unread message

W.S. Hager

unread,
Jan 13, 2013, 12:11:01 PM1/13/13
to persevere...@googlegroups.com
Hi,

Perhaps this falls a bit outside of the persvr scope, but maybe someone on this list has some experience with this issue.

How to deal with localized data? Say, I wanted to add accept-language into the mix, what would be the best way to retrieve only properties for translatable data and still reference the same "thing"?

My first thought would be to simply map localized data:

POST /Product/1
Content-Type=application/json;Content-Language=en

{description:"a good thing"}

would be stored as

{description:[
  {"en":"a good thing"}
]}

while
Content-Type=application/json;Content-Language=nl

{description:"een goed ding"}

would be stored as
{description:[
  {"en":"a good thing"},
  {"nl":"een goed ding"}
]}

Retrieving the data would obviously be:
GET /Product/1
Accept=application/json;Accept-Language=en

{description:"a good thing"}

But there obviously needs to be some mechanism to tell persvr that the data is indeed localized. Perhaps in the schema?

Thanks for any input.

--

W.S. Hager
Lagua Web Solutions
http://lagua.nl

Reply all
Reply to author
Forward
0 new messages