I\'m deciding how to organize URL and put locale into it. I have two choices:
Localization is part of Content-Negotiation in Restful API.
So my preferred way I would do it through headers. HTTP offers standard way of defining wanted language. Have a look at Accept-Language header.
From https://www.w3.org/International/questions/qa-accept-lang-locales:
The HTTP Accept-Language header was originally only intended to specify the user's language. However, since many applications need to know the locale of the user, common practice has used Accept-Language to determine this information. It is not a good idea to use the HTTP Accept-Language header alone to determine the locale of the user. If you use Accept-Language exclusively, you may handcuff the user into a set of choices not to his liking.
My preference:
Accept-Language
header if query parameter is not
specifiedAccept-Language
header is not definedContent-Language
<some-root-tag xml:lang="en-US">
(see http://www.opentag.com/xfaq_lang.htm)