Page 1 of 1

Support REST data in different languages

Posted: Thu Jun 04, 2015 6:21 pm
by Blair Cox

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? :)


Support REST data in different languages

Posted: Thu Jun 04, 2015 8:31 pm
by Serhii Kulibaba

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


Support REST data in different languages

Posted: Thu Jun 04, 2015 8:39 pm
by Blair Cox

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


Support REST data in different languages

Posted: Fri Jun 05, 2015 1:37 am
by Blair Cox

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? :)


Support REST data in different languages

Posted: Mon Jun 08, 2015 1:42 pm
by Serhii Kulibaba

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


Support REST data in different languages

Posted: Wed Jun 10, 2015 4:56 pm
by Blair Cox

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?


Support REST data in different languages

Posted: Thu Jun 11, 2015 3:27 am
by Yurii Orishchuk

Hi Blair,

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

Regards.