Hi all
One of the most common questions I’ve had regarding the Unity Dialogue Engine is wether it supports localization. Well, not directly and yet, yes. Meaning, all you had to do was duplicate the script and then replace the dialogue inside with which ever language you so chose and then simply load one file instead of the other when starting the dialogue. Simple.
With the release of CML Evolution, this question remains the most common question but with CML Evolution, localization is now a heck of a lot more simple. Now, for each dialogue turn, you simply add a new field with the name of the language you want to support and that’s that. With a single line of code change to the default displays, your code is now localized. Well, with one little caveat. You can only have 1 default language which can then appear on multiple lines in the dialogue script. Each separate language needs to be written one a single line and line endings need to be specified with a \n. Example:
<turn> id= 0
[Japanese] Konnichiwa\nHajimemashite
[Afrkiaans]Goeie dag\nAangename kennis
Good day.
Pleased to meet you
That simple to do localization in CML Evolution.
Anyways, as simple as it may be to add localization to any existing display, it is not a feature of CML Evolution by default so I decided to add it for a future release but in the mean time I would release a free plugin to enable a simpler localization experience.
This package includes a new class that derives from CMLDE called CMLLocal. All you need to do is this:
- Drop this class in your Plugins folder
- Open any existing display file and change the parent class from CMLDE to CMLDELocal
That’s it. Everything else stays the same. If you want to start using a new language, change the value of selectedLanguage to one of the enum values. To add support for new languages, open CMLDELocal.cs and add the language(s) to the CMLDELanguages enum and drop a 45x45 image representing the/each language’s flag into a Resources/Flags/ folder and you are done.
There is nothing more to it that that… ![]()
The package also includes a sample display that uses localization and displays the various flags of the different languages above the dialogue. This is merely for demonstration purposes because the dialogue continues each time you click the mouse so each time you change the language it also goes on to the next line in the dialogue. This is to show you how to change your language but it is best placed inside a settings scene and stored from there, rather than changed mid story.
if you DO want to continue using this display but don’t want to show the flags, just tick the show_flags box in the inspector.
I also include a (rather involved [read: complex] ) sample script as an example. Don’t be swayed by all the keys and unknown stuff
This is a script from an up coming demo I’ve been working on and would like to get done s soon as I finally get some time for myself… So yeah, it does do a lot of custom stuff that obviously won’t work on your end but since the dialogue requires some in-game quests to be performed before you GET to the tricky stuff, at least the script should still be usable to you as is. At least it serves as an example of how I added a second language to my demo ![]()
Enjoy.
CML Evolution information:
http://forum.unity3d.com/threads/154384-CML-Evolution-Progression-tracking-Dialogue-Save-Shop-and-Inventory-system
CML Evolution on the asset Store:
CML Evolution on my website:
http://cmlevolution.mybadstudios.com
1198469–47801–$Localization.7z (400 KB)


