Load translaltions for each language ON DEMAND

1 year 3 months ago #3272 by nelsonlarocca
Hi !

Is there any way to load the translations for each language on demand instead of keeping all in the local storage ?

I mean, suppose the language of the device in English and the user switches to French, that would mean loading the French terms from the "cloud" removing the English ones. If the user later decides to switch to a different one, right the same process.

Our app will be translated to several languages so the idea is to optimize storage.
Any help will be appreciated.

Please Log in or Create an account to join the conversation.

1 year 3 months ago #3274 by Frank
If you need to load the translations from the cloud, you can do that by using AssetBundles.

Instead of having all your localization in I2Languages.prefab, create a copy of that prefab for each Language and add them to different bundles.

Then, whenever you switch languages, download the bundle, and instantiate the LanguageSource into the scene. As far as the LanguageSource is enabled, your localize component will be able to use its translations.

Another way, is to create a CSV spreadsheet for each language and store them in your server.
Then, whenever you need to load the new language, just download it and call Import_CSV to add it to the I2Languages.prefab

An example of this can be found at:
See the DownloadCSV function.

Hope that helps,

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

Time to create page: 0.305 seconds
Template by JoomlaShine