Best way to add term at runtime
8 years 11 months ago #1205
by Yamanyar
Best way to add term at runtime was created by Yamanyar
Hi,
My game can download new levels via AssetBundles.
New levels contain tutorials defined in a json. In this json, I have a term like "Level23_Tutorial_Description".
However this term had not been defined before. How can I update I2 with new term and corresponding translations?
Can I update I2 permanently at client?
Thanks!
My game can download new levels via AssetBundles.
New levels contain tutorials defined in a json. In this json, I have a term like "Level23_Tutorial_Description".
However this term had not been defined before. How can I update I2 with new term and corresponding translations?
Can I update I2 permanently at client?
Thanks!
Please Log in or Create an account to join the conversation.
8 years 11 months ago #1206
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Best way to add term at runtime
Hi,
Normally when using bundles, you will want to use local/scene LanguageSources, similar to how the I2L sample scenes are set.
You can do that by creating an empty object in one of the scenes in the bundle and add a LanguageSource component to that object. Then, you need to localize the content of your bundles with the terms in that LanguageSource and not the ones in I2Languages.prefab.
So, for you project, you will localize everything that its not in a bundle with the terms in I2Languages.prefab. And then anything that its in a bundle with the terms in the LanguageSource inside one of the bundle's scene.
The way the plugin works, its that anything in I2Languages.prefab its a Global term, so that can be accessed in any scene. Then, any LanguageSource instantiated in a scene, its a local term and it can be only used while that source exists (while the scene is loaded, and the source its not manually destroyed).
Another way can use, its to place all your terms inside a CSV file and pack that file inside the bundle. Then create an script that when loading a bundle, if it has a CSV file, that file its imported into the I2Languages.prefab:
Hope that helps,
Frank
Normally when using bundles, you will want to use local/scene LanguageSources, similar to how the I2L sample scenes are set.
You can do that by creating an empty object in one of the scenes in the bundle and add a LanguageSource component to that object. Then, you need to localize the content of your bundles with the terms in that LanguageSource and not the ones in I2Languages.prefab.
So, for you project, you will localize everything that its not in a bundle with the terms in I2Languages.prefab. And then anything that its in a bundle with the terms in the LanguageSource inside one of the bundle's scene.
The way the plugin works, its that anything in I2Languages.prefab its a Global term, so that can be accessed in any scene. Then, any LanguageSource instantiated in a scene, its a local term and it can be only used while that source exists (while the scene is loaded, and the source its not manually destroyed).
Another way can use, its to place all your terms inside a CSV file and pack that file inside the bundle. Then create an script that when loading a bundle, if it has a CSV file, that file its imported into the I2Languages.prefab:
CSVstring =... read the CSV file from your bundle ...
LocalizationManager.Sources[0].Import_CSV(string.Empty, CSVstring, eSpreadsheetUpdateMode.Merge, ';');
Hope that helps,
Frank
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
The following user(s) said Thank You: Yamanyar
Please Log in or Create an account to join the conversation.
Time to create page: 0.161 seconds