Menu translated to UK English even for US users

20 views
Skip to first unread message

Tom M

unread,
Sep 26, 2019, 7:33:43 AM9/26/19
to vim...@googlegroups.com
Hello,

I have set LANG to "en_US.UTF-8" in my environment. But when I launch gvim and it comes to creating menus, the menu.vim script ends up executing translations for UK English.

The reason seems to be the fact, that there is no lang/en_us.utf-8.vim translation script shipped with Vim. So when menu.vim fails to find translation for lang/menu_en_us*.vim filename pattern it throws away the "_en.utf-8" suffix from it and accepts whatever flavour of "en" language which happens to be the one for "en_gb" by default.

It's not a big deal. And I know that I can set langmenu to 'none' in my .vimrc to work around the issue. But I think it would do no harm to include a dummy menu_en_us.utf-8.vim file (or it's latin1 variation) in the default vim runtime files. Or modify the menu.vim script to skip doing translations in case of "en_US" v:lang. All US users would benefit from it.

What do you think?

Tom

Bram Moolenaar

unread,
Sep 26, 2019, 2:22:00 PM9/26/19
to vim...@googlegroups.com, Tom M
Hah, never noticed this. It's a simple change:

@@ -29,7 +29,8 @@
let s:lang = v:lang
endif
" A language name must be at least two characters, don't accept "C"
- if strlen(s:lang) > 1
+ " Also skip "en_US" to avoid picking up "en_gb" translations.
+ if strlen(s:lang) > 1 && s:lang !~? '^en_us'
" When the language does not include the charset add 'encoding'
if s:lang =~ '^\a\a$\|^\a\a_\a\a$'
let s:lang = s:lang . '.' . &enc


--
Computers are not intelligent. They only think they are.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages