Hi,
I,ve been looking at the i18next plugin and I was wondering what you need to do about apps populated by db, I assume I will need a collection for each language, how does it switch collections, or have I got it wrong
thx
Hi,
I,ve been looking at the i18next plugin and I was wondering what you need to do about apps populated by db, I assume I will need a collection for each language, how does it switch collections, or have I got it wrong
thx
Hello,
You can specify dynamic collection name for read service with URL: {database_url}/collections/{collectionName}/
collectionName is a request-parameter to which pass the collection name.
Thx Nikita,
have you any docs on this, or any guidelines as how to do this in apperyio with the I18next plugin..
I can understand how components are marked,
but cant find anything on how to use a collection read service for example and switch the collection to the collection that matches the device language, if that makes any sense ![]()
Hi,
You can get system language in this way:
var lng = navigator.language || navigator.userLanguage;
this lng variable pass as request-parameter. This allows to use different collections for different languages.
Maybe I wasn't clear on my question.
as far as I can understand in the tutorial the plugin js gets the users device language,
and I need to reference and mark components with text for each language and save in the locals file.
it must be in this file I need to reference the collection to use.
so I am looking for an example of how to reference this collection which is english
{database_url}/collections/meatpizza/
to this collection which is spanish
{database_url}/collections/esmeatpizza/
thx
Hi,
Please look at the first answer:
You can specify dynamic collection name for read service with URL: {database_url}/collections/{collectionName}/
collectionName is a request-parameter to which pass the collection name.
You should pass the string "meatpizza" in request-parameter collectionName, then appery.io will return "meatpizza" collection.
"meatpizza" is already returned with this parameter {database_url}/collections/meatpizza/
as the 1 language the is setup in
if I ad the plugin, mark all components when the plugin detects spanish, the components will be in spanish
how to I reference or markthis collection with this URL
{database_url}/collections/esmeatpizza/
when the plugin detects spanish as the device language
or have I misunderstood how the plugin works
cheers
Hello,
Most likely you haven't understood how this plugin works. You should create json-files with content:
component name : translation
(cf. http://docs.appery.io/tutorials/build...).
and you shouldn't create different services. If it's necessary for you, you should just execute
one or another service for each language, or as we've recommended earlier - one service for all the languages.
Thx Nikita,
your right, I really dont understand the capabilities of this plugin
this is what I thought
this plugin is a bind translator
all translations for all languages must be in the locals file for each language with all components identified, marked and the translation, this bit I get.
my app currently runs 13 read services
the way I understood it was,
I would need to make 13 collections for in each language
the mapping is already done for the english language and I thought by referencing for eg. the spanish version of 1 collection, this collection would be used instead of the english version.
sorry about this, but theres very little info on this plugin anywhere
Hi,
Do you have more question?