Blair Cox
Posts: 0
Joined: Thu Jun 04, 2015 2:29 pm

Support REST data in different languages

I need to support localization in my app. I have the i18next figured out, but want to handle the switching of content in different languages as easily as possible. I'm pulling my data in via REST. So I figured a nice way to handle this would be depending on the language setting chosen, the datasource would be set.

Ex.

if French = use datasource1
if English = use datasource 2

But I have no idea how or where to do this. Any suggestions for a newbie? :)

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Support REST data in different languages

Hello Blair,

Sure it is possible.
1) Use URL for all DB Services like: {database_url}/collections/collectionName
collectionName - name of your collection (all DB should have the same collections)
2) Add request parameter database_url
3) Set value for this parameter = name of the database, according to current language

Blair Cox
Posts: 0
Joined: Thu Jun 04, 2015 2:29 pm

Support REST data in different languages

Awesome thanks! but... do you have an example? Some code to refer to? Sorry, learning this stuff :)

Blair Cox
Posts: 0
Joined: Thu Jun 04, 2015 2:29 pm

Support REST data in different languages

I guess what I need is the JavaScript example or tutorial for setting this please. The interface and tutorials I've located use the menu interface. This will require me to do it manually. I'm not yet familiar enough with the system to do that. Anyone able to point me in the right direction? :)

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Support REST data in different languages

We don't have such tutorial. Could you clarify what have you tried and what exactly does not work?

Blair Cox
Posts: 0
Joined: Thu Jun 04, 2015 2:29 pm

Support REST data in different languages

I don't know how to set the database other than to use the menu and choose load - invoke service - select from dropdown.

I assume the method you state above requires javascript?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Support REST data in different languages

Hi Blair,

Please read more info here: https://getsatisfaction.com/apperyio/...

Regards.

Return to “Issues”