Free dialogue localization plugin for CML Evolution

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:

  1. Drop this class in your Plugins folder
  2. 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… :smile:

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 :stuck_out_tongue: 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 :slight_smile:

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)

Screenshot of an Afrikaans RPG. Now THERE’s something you don’t see every day :stuck_out_tongue:

Great package,

Does this also work on Flash?

I haven’t actually TESTED it on Flash but there is nothing in there that I can think of that might cause it to NOT work with Flash… So I would venture a resounding “Yes”.

If you want to test it, though, get the free version of CML from my store. The CML Evolution package has more features and simplifies it a great deal but the general workflow is the same. If CML works for you then CML Evolution will work for you also. And if CMLE works then this simple plugin is not going to cause any problems… So yeah, get CML, play with it, then get CML E after you are happy with it :slight_smile:

Actually, hold on… there is one little issue… One thing to note, is that I create 3 methods of loading files from disc and create 2 methods to save it back… one is via PlayerPrefs, the other is via Resources folders and the third option is via direct read/write. Flash doesn’t like this third option so download CML, delete the load and save function that uses this third method and THEN everything will work like a charm :smile:

Very nice! Thanks for putting this together, already added it to my project and will be asking my friend to start doing some translations for me!

MrDude,

I downloaded CML from the asset store into a new empty project and published the Demo scene without deleting anything and it worked.
Unity Flash 4.1.2

Here is the link to the flash exported file. Dropbox - Error - Simplify your life

Thanks for the update rocki :slight_smile:

@LeeAllen
I am happy you are happy… but this package is now officially no longer required :slight_smile:

I have just updated the package to now natively support localization and uploaded it to the asset store.
As soon as they approve it, you can just re-download CML Evolution and you are good to go :slight_smile: At least now you still have a cool looking HUD :slight_smile:

Existing projects will continue to work without requiring any modification. New projects can simply add their alternate text as described above and then just need to set the CMLDE.Language string to their required language. That simple.

One thing to note, though, using the plugin you need to separate the lines using “\n” but with the native support you need to separate the lines using “\n”. Only difference :slight_smile:

Enjoy:)

Screenshot from the CMLDE demo:
1215442--49644--$Screen Shot 2013-04-10 at 10.44.18 AM.jpg
Little screenshot from a demo I am creating:

MrDude,

Localization Feature – This is a kicking and wicked feature and is super handy for multilingual apps. Very nice.

I have some newbie questions while studying the Demo Dialogue script for the Vikings.

id=16
[next]-1
[keys]- ramble {:ramble}
[Afrikaans]As ek dit gaan oorleef om hierso te staan gaan almal my naam ken!
If I survive standing in this shade, I am going to be
the greatest warrior that ever died in all of history

Wait, what?

Can you explain what this means “[keys]- ramble {:ramble}”
I read the Tutorial in the document folder but don’t quite know what {:ramble} does in this context.

Better question… How do you even HAVE this? It’s still awaiting approval…! :open_mouth: Are you one of John’s group?

Either way, well spotted :slight_smile: This is a new feature I was going to announce once the package got accepted. CMLDE has always allowed for dynamic text by allowing you to display any key’s value in your dialogue. I.e.
id=0
I now have (:gold} {:currency} after my last pickup

This would result in the text: “I now have 315 Gold after my last pickup”.
As of this latest CMLDE update, you can now use key values in your keys also.

In this example, you will notice that the character keeps getting an extra ramble key (+ ramble 1) each time he rambles. This way, you can now remove all the ramble keys (- ramble {:ramble} ) without having to go and count how many he has since {:ramble} will result in the actual, current value being used.

You can use text replacement for both or either of the key name and the key value so if you have a reason to do so you could also say:
id=0
[keys] - {:equiped_weapon:name} {:equiped_weapon}

Coo, huh? :smile: :wink:

Edit:
By the way, you can download the GUI used in that last screenshot, for the localized version, here:

This is so Fantastic. Thanks for the explanation. The more I learn about CML, the more amazing it gets.

I can’t help smiling each time someone “gets it” :slight_smile:
No pun intended :slight_smile: Welcome to the fold :smile:

Right, the update is now live so all of you who have already bought the package, feel free to download the update and enjoy your new features :slight_smile:

Announcement

Have fun :slight_smile: