Add new keys after build?

More
7 years 3 months ago #2416 by Sargent
Hi,

Is it possible to add new keys into the Localization file after the game has been built?
Also, is there a way to allow for the Localization file to be edited without rebuilding the game?

It seems new keys are not found and existing keys are stored somewhere else other than StreamingAssets on load, so changes made to the file are not taken into account.

Does this behavior sound correct or am I missing something simple?

Thanks

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

More
7 years 3 months ago #2417 by Frank
Replied by Frank on topic Add new keys after build?
Hi,
Yes, there are a few ways to change/add localization after the game is built, and even auto-update the games in the players devices.

The main method is to use Google Live Synchronization

Basically, you link your I2Languages.prefab to a Google Spreadsheet, build your game, and then any change you make to the spreadsheet, its automatically downloaded into your players devices.
This downloaded data is saved using PlayerPrefs and after it has been downloaded, the localization that was built into the game is discarded and this one is used every time the game starts.



If you just want to add new localized scenes or UI, and you are using AssetBundles to deliver your new content to your players. Then just add a LanguageSource to the first scene in your AssetBundle, and keep that scene loaded. The game will use the localization from I2Langauges.prefab and from your assetBundle.


If you want to allow users to make Mods. Then create a csv file with the localization your players can change. Then, at runtime, load the CSV file using:
var CSVstring = File.ReadAllText(Application.streamingAssetsPath + "/ModLocalization.csv");
I2.Loc.LocalizationManager.Sources[0].Import_CSV( CSVstring );

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

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

More
7 years 3 months ago #2418 by Sargent
Replied by Sargent on topic Add new keys after build?
The current version of of I2 I have does not have an Import_CSV that only takes one argument. The current one requires a Category. What should I supply for Category in a case like this when I want to load the entire file?

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

More
7 years 3 months ago #2419 by Frank
Replied by Frank on topic Add new keys after build?
Import_CSV(null, CSVstring)

passing null as the category will load all terms as they are in the file.

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: Sargent

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

Time to create page: 0.155 seconds
Template by JoomlaShine