I'd like to have my resources localized to several languages. How multiple languages should be posted to resource using REST architecture?
resource: /chapters, /chapters/:id
When POST is issued to chapters, client send data structure:
{localizations: { en: {title: 'New chapter' },sk: {title: 'Nova kapitola'} }}
and new chapter with localizations en and sk is created.
When client wants to access this chapter at URL /chapter/1, only one language mutation should be returned in representation. How should I implement locale scoping? I can use Accept-Language HTTP header with desired locale, Accept-Language: sk, or i can include locale into URL like /chapters/1/en.
Also, how PUT request should be handled? For most of the time only one language mutation would be updated, but occasionally 2 or more of them would be updated.