Page MenuHome

Fix for T82459 - Input Language Independent of Display Language
ClosedPublic

Authored by Harley Acheson (harley) on Feb 1 2021, 1:47 AM.

Details

Summary

The following only affects the Windows platform.

When we set the language in Blender (Edit / Preferences / Interface / Translation) it is only only selects the OUTPUT language used for formatting display strings. It has nothing to do with the language you are currently using, what keyboard you are using, or what input language you have selected.

For input language (and keyboard type) - on the Windows platform - we already properly get the input language from the OS, and properly change the input language when you change it on the taskbar (by dealing with the WM_INPUTLANGCHANGE message). This means no matter what language you select inside Blender, if your Tasktray says the keyboard language is Chinese it is properly treated that way inside Blender. It is just that an IME (Input Method Editor) is not allowed to launch. So you are in Chinese but can only enter English characters.

We are purposely preventing IME for most languages, for a reason for this that made sense until fairly recently. the comment for blt_lang_check_ime_supported() says:

/**
 * Test if the translation context allows IME input - used to
 * avoid weird character drawing if IME inputs non-ascii chars.
 */

This is because we used to only use the larger international font for these languages, but used a smaller and simpler font for all other languages. Therefore if you switched input language you were likely to see little "tofu" squares rather than proper glyphs. But we changed that last year and now we always use the multi-language font regardless of language selected.

So this patch just sets blt_lang_check_ime_supported() to true (if WITH_INPUT_IME). The following shows blender set to Spanish, but entering Chinese because I have set my input language to that in the Taskbar:

Diff Detail

Repository
rB Blender

Event Timeline

Glad you're on top of this stuff!

This revision is now accepted and ready to land.Feb 1 2021, 8:12 PM

No need for the odd caching of local variable ime_is_lang_supported, since BLT_lang_is_ime_supported() will always return true.

Just adding a comment to BLT_lang_is_ime_supported(), explaining our past dependency of input language on output language.

Just bad grammar on comment.

Confirmed this doesn't tackle T84081.