[vim/vim] MS-Windows: messages are not in the display language (PR #20860)

1 view
Skip to first unread message

h_east

unread,
10:45 AM (10 hours ago) 10:45 AM
to vim/vim, Subscribed
Problem:  On MS-Windows the messages use the language of the regional
          format, not the language that Windows is displayed in.
Solution: Use the display language for the messages, with the other
          preferred languages as fall back.  Make ":language messages"
          overrule it.

fixes: #20855


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20860

Commit Summary

  • dc92327 MS-Windows: messages are not in the display language

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20860@github.com>

h_east

unread,
10:53 AM (10 hours ago) 10:53 AM
to vim/vim, Subscribed
h-east left a comment (vim/vim#20860)

Not a duplicate of #20204 (that one is about 'statusline' %P). #20201 is
the closest related report.

The report is correct, and the cause is in Vim itself: set_init_lang_env() in
src/option.c sets $LANG from GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME), which is the regional format, not the display
language. gettext then picks the messages from that.

I have a patch that takes the display language instead, using
GetUserPreferredUILanguages(), and only when none of $LANG, $LANGUAGE,
$LC_ALL and $LC_MESSAGES is set, so setting those keeps working as before.
$LANGUAGE gets the fall-back list, $LANG the language itself. The default
for 'helplang' follows the same value now.

The list stops after English on purpose: Vim ships no en catalog, so gettext
would otherwise fall through to a later preferred language, and a preference
list of "en-US, de-DE" would end up with German messages.

Verified on Windows 11 with display language Japanese and regional format
German (Germany): messages are now Japanese instead of German, the other locale
categories still follow the regional format, and set LANG=de still gives
German messages.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20860/c5105736082@github.com>

Christian Brabandt

unread,
2:02 PM (7 hours ago) 2:02 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20860)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20860/c5107856641@github.com>

Reply all
Reply to author
Forward
0 new messages