Properly handling mixed languages at run-time

Started by
2 comments, last by Zipster 9 years, 4 months ago

I recently spent a few days shoring up the localization support on the game I'm working on, and came across the rather interesting case of handling multiple languages (and their fonts) simultaneously in the UI.

We allow the user to launch the game in one of our supported languages, and that's the language used to display all text. However when it comes to input, we use the active input locale for character conversion, which may or may not be identical to the launch language. The issue we're having is when the user launches the game in one language, like English, but switches their input locale at run-time to be another language that has a unique set of glyphs, like Korean, the currently loaded font(s) don't have all the necessary glyphs.

The most obvious solution would be One Font To Rule Them All, containing every glyph for every supported language, but the publisher has already locked in our font set so that's a non-starter. The *next* most obvious solution would be to dynamically load and use the proper font(s) on input fields when the input locale changes, however we've run into an edge case I'm not sure how to handle: the user begins typing in one language, switches to another language mid-sentence, and continues typing in that new language. I'm not sure how to handle that situation short of enabling HTML on the text fields, but that in and of itself would have its own host of issues and fallout.

Does anyone have any experience in this area of UI localization? I imagine that most popular online games handle this situation gracefully and that there is a (hopefully) "elegant" solution still available to me?

Advertisement

To be honest, I'd just replace any unsupported characters with something like an underscore _ or the white rectangle glyph ? and be done with it. I don't think it would adversely affect a significant number of users, and if you get any support requests raised, you can just tell them that they ought to set their in-game language to match their locale setting.

Handle edge cases logically, but brutally.

In the edge case you mentioned, the user starts inputting a string in one language and then switches to another, clear the string and make him start again.

Users are stupid, it's a fact of life. Designing your code to handle everything any user wants to do in exactly the way he/she/it wants to do it, is an excercise in futility.

I once had a bug report "If you press these five keys with your left hand, these five keys with your right hand, and press the spacebar with your nose.... the game crashes".

Do you think I coded a bespoke solution for that problem ? smile.png

Handle edge cases logically, but brutally.

I generally agree that as long as you handle edge cases logically and consistently, users will eventually accept and adapt to how those cases are handled. However in this particular situation I think it's reasonable for the user to expect mid-sentence language changes to work properly, especially since not every language will have proper translations for all the modern online gaming parlance. I also tend to rely on precedence when it comes to UI behavior, and indeed when I tried this out in a few other online games, I could seamlessly switch between any language at any time in the chat dialog and they handled it appropriately. I don't know how important an edge case this is to fix, but I'd at least like to perform my due diligence smile.png

This topic is closed to new replies.

Advertisement