Coherent GT 1.6 – Your new secret weapon to fight the monsters in your UI
It’s pretty common nowadays for the big titles to ship with multiple supported languages. Native speakers of large markets often expect exactly that.
Localization is one of the many issues in software engineering that look easy at first sight. When underestimated however, it gradually starts to look like Viktor Frankestein’s monster – stitched up from various pieces of repulsive code. And you often end up wondering whether and how do these pieces even work. Here is an accurate explanation of the Localization horror story.
We at Coherent Labs can’t really kill Frankenstein’s monster for you, but we can give you this awesome monster-destroying rifle that can ease your hunting.
Update: Check the latest release – Coherent GT 2.0
Introducing the localization API
How cool it would be if you could add an attribute to your HTML elements and have their content translated automatically? Well, with Coherent GT 1.6.1 you can do that! But wait, does that mean that you must throw away that nice localization system that you just spent 2 months on? No, of course not, you just tell Coherent how to interact with it:
class MyLocalizationSystemBridge : public Coherent::UIGT::LocalizationManager
virtual const char* Translate(const char* key) override
// Lookup the key and translate it according to the current locale
// When initializing Coherent GT
settings.LocalizationManagerInstance = new MyLocalizationSystemBridge();
auto system = InitializeUIGTSystem(settings);
Now go ahead and tell your designers to add the data-l10n-id attribute to any HTML elements deemed worth of translation and watch our rifle blast the monster to stitches and patches:
When you load the page, the button’s text will be set to the return value of MyLocalizationSystemBridge::Translate when passed "text-for-destroying-the-monster" . To see this in action, check out the new localization sample found in the Coherent GT for native package (or the updated localization map for UE4):
Furthermore, you can use request translations on demand by calling engine.translate("text-for-destroying-the-monster") . Also if you’ve changed the current locale, you can request Coherent GT to reload all localized text by calling engine.reloadLocalizaton() . Both of these are demonstrated in the sample mentioned above.
Enhancing user experience with gamepad
Good games let the users play them any way they wish and gamepad support is among the most often requested features. Some developers believe that adding gamepad support is as simple as mapping the gamepad input to gameplay actions. I hope you know well enough to never do that. You can achieve a good gamepad support only if you plan and design everything in your game for it. Naturally this includes the user interface. Easy tasks with mouse and keyboard like drag & drop or typing your character’s name can become nuisances if not properly reworked to fit the gamepad.
Assuming you have defeated both the localization and gamepad monsters, you should take some well-deserved rest. Put the rifle we provided aside. Coherent GT 1.7 will arrive in early December and will be more like a tank, not just a rifle. An amphibious, flying tank that also transforms lead into gold and leaves a trail of unicorn fairy dust*.
The secret ingredient will be that Coherent GT 1.7 will feature a new, custom-built rendering engine with codename Renoir (after the French painter). This will bring many improvements to the rendering-side of the library. Stay tuned to learn more and if you have any questions leave a comment below, in the forums or on twitter!
* Neither fairies nor unicorns have been hurt while creating the release.