Re: [vim/vim] MS-Windows: messages are not in the display language (PR #20860)
h_east (Vim Github Repository) <[email protected]> Tue, 28 Jul 2026 07:53:10 -0700
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/20860/[email protected]> |
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 or view it on GitHub: https://github.com/vim/vim/pull/20860#issuecomment-5105736082 You are receiving this because you are subscribed to this thread. Message ID: <vim/vim/pull/20860/[email protected]> -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20860/c5105736082%40github.com.