How to add a country/language code

More
8 years 8 months ago #848 by cedtat
Hello,

I was wondering if there was a way to add a new language/country code.
I have to create an english localization for LEBANON (which is different from other english localizations). It is not a standard code but it will be great if I can handle that by creating a "en-LB" code.
Is there a way to add it in I2 ?

Thank you,
Cédric

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

More
8 years 8 months ago #850 by Frank
Hi,
You can add any name directly in the Language Source.

However if you want to create a new language code, you will need to add a new line in one of the scripts.
Nonetheless its really easy:

Just open Assets\I2\Localization\Scripts\Google\GoogleLanguages.cs

At the end, there is an array with all the ISO languages, codes and the code used as fallback in Google Translator.
To add Lebanon specialization to english, just add the definition at line 219.

It should look like:
			{"English/Caribbean", 	new LanguageCodeDef(){Code="en-CB", GoogleCode="en"}},
			{"English/Ireland", 	new LanguageCodeDef(){Code="en-IE", GoogleCode="en"}},
			{"English/Jamaica", 	new LanguageCodeDef(){Code="en-JM", GoogleCode="en"}},
			{"English/New Zealand", new LanguageCodeDef(){Code="en-NZ", GoogleCode="en"}},

			{"English/Lebanon, new LanguageCodeDef(){Code="en-LB", GoogleCode="en"}},

			{"English/Republic of the Philippines", new LanguageCodeDef(){Code="en-PH", GoogleCode="en"}},
			{"English/South Africa",new LanguageCodeDef(){Code="en-ZA", GoogleCode="en"}},

After the script gets compiled, the code and language will show in the Language Source popups.

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
8 years 8 months ago #851 by cedtat
Thank you Frank,
This is exactly what I was looking for :)

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

Time to create page: 0.149 seconds
Template by JoomlaShine