How do I go about sharing localization data between projects?

More
3 years 3 months ago #4400 by gfernandes
I have a shared library I use in my Unity projects that contains some UI that needs localization. This UI is shared across projects that use the library. How do I go about getting the localization data shared across all projects?

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

More
3 years 3 months ago #4401 by Frank
Hi,
Sharing is quite easy.
If you are using Google Spreadsheets, you could use the same spreadsheet in every project.

If you instead want to use some shared terms and some terms specific to a project. Then you could setup 2 LanguageSources. Link one of the sources with the shared Google Spreadsheet, and the other source with an spreadsheet that only holds the terms specific to that project.

If you are not using Google Spreadsheets, then you could manually copy the same LanguageSource asset to all your projects. You can even automate this using GIT, SVN or other source control system.

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
3 years 3 months ago - 3 years 3 months ago #4402 by gfernandes
Hi Frank,

I've tried creating another language source but couldn't get it to work properly. The Localize components couldn't find keys added to the second language source, and if I tried to reference another language source in the component things didn't work at all. What am I missing? I can't figure out how to make more than one language source work simultaneously.

Btw, I'm using version 2.8.11.f1.

I've updated to the latest version and the problem persists.
Last edit: 3 years 3 months ago by gfernandes.

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

More
3 years 3 months ago #4407 by Frank
Hi,
To have multiple LanguagesSources, you have two ways:
Either create the LanguageSource as a GameObject in one of your scenes (while the gameObject is loaded, the LocalizationManager will find it and allow you to use it).

or you can duplicate the I2Languages asset and place the new in a Resources folder. For this second way, you will need to tell the plugin that it should load that asset from the resources.
This can be done by modifying the GlobalSources array to add the name of the asset.

For example:
Assets\I2\Localization\Scripts\Manager\LocalizationManager_Sources.cs line 16
public static string[] GlobalSources = { "I2Languages", "SharedLanguages" };

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
3 years 3 months ago #4409 by gfernandes
Thanks a lot. I had a hard time figuring out LanguageSource is actually a MonoBehaviour since it's called just "Source" in the hierarchy. (Just leaving this here if anyone else falls into the same problem).

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

Time to create page: 0.218 seconds
Template by JoomlaShine