Welcome, Guest
Username: Password: Remember me

TOPIC: Add new keys after build?

Add new keys after build? 2 months 3 weeks ago #2416

  • Sargent
  • Sargent's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
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
The administrator has disabled public write access.

Add new keys after build? 2 months 3 weeks ago #2417

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 897
  • Thank you received: 193
  • Karma: 57
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
The administrator has disabled public write access.

Add new keys after build? 2 months 3 weeks ago #2418

  • Sargent
  • Sargent's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
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?
The administrator has disabled public write access.

Add new keys after build? 2 months 3 weeks ago #2419

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 897
  • Thank you received: 193
  • Karma: 57
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 administrator has disabled public write access.
The following user(s) said Thank You: Sargent
Time to create page: 0.243 seconds
Colors