Welcome, Guest
Username: Password: Remember me

TOPIC: How to add a country/language code

How to add a country/language code 3 years 1 month ago #848

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

How to add a country/language code 3 years 1 month ago #850

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

How to add a country/language code 3 years 1 month ago #851

  • cedtat
  • cedtat's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
Thank you Frank,
This is exactly what I was looking for :)
The administrator has disabled public write access.
Time to create page: 0.150 seconds
Colors