aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
diff options
context:
space:
mode:
authorRui Abreu Ferreira <raf-ep@gmx.com>2014-07-01 20:54:08 +0100
committerRui Abreu Ferreira <raf-ep@gmx.com>2016-04-29 23:26:05 +0100
commit5f6e63bf38db0705c4cd263bec57fbda276d4e26 (patch)
tree4dbfa1de4abcdb13b9cc69adf109e2ed82fcf92f /src/nvim/ex_cmds2.c
parent126e4758076aec243a05c5e838c2a7f5197ad678 (diff)
downloadrneovim-5f6e63bf38db0705c4cd263bec57fbda276d4e26.tar.gz
rneovim-5f6e63bf38db0705c4cd263bec57fbda276d4e26.tar.bz2
rneovim-5f6e63bf38db0705c4cd263bec57fbda276d4e26.zip
Windows: without libintl use LC_CTYPE instead of LC_MESSAGES
If libintl is not available, LC_MESSAGES is not defined. For now fallback to using LC_CTYPE. Neovim and Vim have diverged significantly in ex_cmds2.c concerning this logic. In other locations the fallback is actually LC_COLLATE, but in this case Vim calls get_mess_env() (which in turn falls back to LC_CTYPE). In Neovim get_mess_env() is only available with libint. This means we are not completely consistent with Vim when handling LC_ environment variables and do not build against libintl.
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r--src/nvim/ex_cmds2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index a0a0b9d3a5..6723bfc7e0 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -3183,8 +3183,11 @@ void set_lang_var(void)
* back to LC_CTYPE if it's empty. */
# ifdef HAVE_WORKING_LIBINTL
loc = (char *) get_mess_env();
-# else
+# elif defined(LC_MESSAGES)
loc = get_locale_val(LC_MESSAGES);
+# else
+ // In Windows LC_MESSAGES is not defined fallback to LC_CTYPE
+ loc = get_locale_val(LC_CTYPE);
# endif
set_vim_var_string(VV_LANG, loc, -1);