Page MenuHome

UI: Changes to Language Selection
ClosedPublic

Authored by Harley Acheson (harley) on Mar 21 2020, 11:46 PM.

Details

Summary

With the commit of D6854 we are using just the international fonts. But this means that we still have a "Translation" checkbox in Preferences, but it does nothing useful.

This patch removes that checkbox and simplifies this area of Preferences.

Once applied you can always easily change the language. Default is "English" and with that chosen the other options for translating tooltips, etc are cleared and disabled.

After selecting Japanese all options are enabled and turned on. That way the simple change of language has the most affect. For example, since Translate Interface is enabled immediately it means that all these other options are labeled correctly. It also means that we could put just the language list on the Splash screen and not have to include all the other checkboxes.

Diff Detail

Repository
rB Blender

Event Timeline

It seems to me that at least this could be clearer. Not everyone knows what IME is short for - I had to go look it up. At a minimum the tooltip could explain that it affects the input method. But, probably it could be even clearer still.

On a broader note, it's not entirely clear to me where and how this should be controlled - is it usually set per app, or is it the OS's job to manage this? We had similar requests for people who use AZERTY layouts who want to use QWERTY for shortcuts, but AZERTY for text input. It's also not really clear to me if that should really be set per-app. I would have thought it was the job of the OS.

I am a little afraid that adding controls for adjusting the keyboard input opens a can of worms, because many regions may have all sorts of different things they might want to control, and I don't really see these kinds of things in other apps - again you usually control this centrally in the OS & keyboard input settings.

Harley Acheson (harley) edited the summary of this revision. (Show Details)

Updated to reflect the current state of master. For other changes I have updated the original first comment.

Brecht Van Lommel (brecht) requested changes to this revision.Mar 26 2020, 11:29 AM

We want English to remain the default, not Automatic which follows the operating system language. The quality of many translations is not good enough, and for many users English is preferred since they are familiar with the terminology in English from other applications, which are often not translated (or only for Japanese and Chinese). That's why D3705 changed the default to English.

For IME, I would like to understand why we need an option for this. My understanding is that switching input language can be done per application, using a keyboard shortcut or some other method. For someone using IME this would be something that's already familiar. We listen to WM_INPUTLANGCHANGE on Windows to accommodate this. Maybe that needs to be improved in some way rather than adding a preference?

This revision now requires changes to proceed.Mar 26 2020, 11:29 AM
Harley Acheson (harley) planned changes to this revision.Mar 26 2020, 3:10 PM

@Brecht Van Lommel (brecht) - We want English to remain the default, not Automatic...

Yes, of course. I had not thought that through correctly at all.

That's why D3705 changed the default to English.

Yes, I should have looked at D3705. I think there is exactly what I need in that.

For IME, I would like to understand why we need an option for this.

I think I should drop that, at least for now. Otherwise I am guessing the need for it from a comment by one user. Easy to add it later. And we may not ever need it if we get improvements like https://developer.blender.org/D6861

Harley Acheson (harley) retitled this revision from UI: Enable IME Separately from Language Selection to UI: Changes to Language Selection.Mar 26 2020, 5:31 PM
Harley Acheson (harley) edited the summary of this revision. (Show Details)

Updated so that English is the default language, not automatic, by incorporating parts from D3705.

Updated to current state of master.

Brecht Van Lommel (brecht) requested changes to this revision.Apr 6 2020, 6:45 PM
Brecht Van Lommel (brecht) added inline comments.
release/scripts/startup/bl_ui/space_userpref.py
237–239

Not sure why this was changed to "International", I don't think that name is better than "Translation".

source/blender/blenloader/intern/versioning_userdef.c
759

Add userdef->transopts &= ~USER_DOTRANSLATE_DEPRECATED;, otherwise the language will always reset to english on loading the preferences.

source/blender/blentranslation/intern/blt_lang.c
392–398

This

if (U.language != ULANGUAGE_ENGLISH) {
  ime_is_lang_supported = STREQ(uilng, "zh_CN") || STREQ(uilng, "zh_TW") ||
                          STREQ(uilng, "ja_JP");
}
else {
  ime_is_lang_supported = false;
}

can just be this now:

ime_is_lang_supported = STREQ(uilng, "zh_CN") || STREQ(uilng, "zh_TW") ||
                        STREQ(uilng, "ja_JP");
This revision now requires changes to proceed.Apr 6 2020, 6:45 PM
Harley Acheson (harley) edited the summary of this revision. (Show Details)Apr 6 2020, 7:56 PM
Harley Acheson (harley) edited the summary of this revision. (Show Details)

@Brecht Van Lommel (brecht) - Not sure why this was changed to "International"

Changed back to "Translation". Locally I had been using that section for non-language localization options, but will cross that bridge if we ever get there.

otherwise the language will always reset to English

Done. Yes, I hadn't quite thought that through right.

This...can just be this now

LOL. Yes, that is much nicer. Thanks!

Brecht Van Lommel (brecht) requested changes to this revision.Apr 7 2020, 7:25 PM

Looks good to me now except for one comment.

It would be good to get an ok from @Bastien Montagne (mont29) as well, as the maintainer of translations.

source/blender/blenloader/intern/versioning_userdef.c
765

Actually I was wrong about this one. We should also bump the subversion and only run this code for preferences from earlier versions. Otherwise it will still reset to English always.

This revision now requires changes to proceed.Apr 7 2020, 7:25 PM

@Brecht Van Lommel (brecht) - should also bump the subversion and only run this code for preferences from earlier versions.

Yes, I just had that in the "Versioning code until next subversion bump goes here" section. I normally don't do an actual version bump in patches since I don't know how long they will take to be approved, if ever, and and normally have a bunch of things on the go at once.

But I have updated the patch to include version bump so it only calls that code for earlier preferences. Although sometimes the version stuff makes my head hurt. LOL

This revision is now accepted and ready to land.Apr 7 2020, 8:29 PM

Hey @Bastien Montagne (mont29), does this seem reasonable? The only real change here is the idea of turning ON "tooltips", "interface" and "new data" when selecting a non-English language. The end-game being the ability to have a single "Language" dropdown on the splash screen.

Generally looks fine, always nice to be able to remove an option.

Just check my notes below regarding RNA update callbacks before committing please.

source/blender/makesrna/intern/rna_userdef.c
316

Don’t understand why those where added, since we already define update callback with NC_WINDOW, this is already called by generic handler rna_property_update?

334

Don’t understand why those where added, since we already define update callback with NC_WINDOW, this is already called by generic handler rna_property_update?

@Bastien Montagne (mont29) - Don’t understand why those where added...

I swear I needed those in there or I didn't see the UI updating itself after those changes, but I just tested without them and it all works fine. So I must have been mistaken or was misunderstood something. Working as expected while changing language or UI font.

Thanks!

This revision was automatically updated to reflect the committed changes.