*mlang.txt* Nvim
VIM REFERENCE MANUAL by Bram Moolenaar
Multi-language features *multilang* *multi-lang*
This is about using messages and menus in various languages. For editing
multibyte text see |multibyte|.
The basics are explained in the user manual: |usr_45.txt|.
Type |gO| to see the table of contents.
==============================================================================
1. Messages *multilang-messages*
Vim picks up the locale from the environment. In most cases this means Vim
will use the language that you prefer, unless it's not available.
To see a list of supported locale names on your system, look in one of these
directories (for Unix):
/usr/lib/locale ~
/usr/share/locale ~
Unfortunately, upper/lowercase differences matter. Also watch out for the
use of "-" and "_".
*:lan* *:lang* *:language* *E197*
:lan[guage]
:lan[guage] mes[sages]
:lan[guage] cty[pe]
:lan[guage] tim[e]
:lan[guage] col[late]
Print the current language (aka locale).
With the "messages" argument the language used for
messages is printed. Technical: LC_MESSAGES.
With the "ctype" argument the language used for
character encoding is printed. Technical: LC_CTYPE.
With the "time" argument the language used for
strftime() is printed. Technical: LC_TIME.
With the "collate" argument the language used for
collation order is printed. Technical: LC_COLLATE.
Without argument all parts of the locale are printed
(this is system dependent).
The current language can also be obtained with the
|v:lang|, |v:ctype|, |v:collate| and |v:lc_time|
variables.
:lan[guage] {name}
:lan[guage] mes[sages] {name}
:lan[guage] cty[pe] {name}
:lan[guage] tim[e] {name}
:lan[guage] col[late] {name}
Set the current language (aka locale) to {name}.
The locale {name} must be a valid locale on your
system. Some systems accept aliases like "en" or
"en_US", but some only accept the full specification
like "en_US.ISO_8859-1". On Unix systems you can use
this command to see what locales are supported: >
:!locale -a
< With the "messages" argument the language used for
messages is set. This can be different when you want,
for example, English messages while editing Japanese
text. This sets $LC_MESSAGES.
With the "ctype" argument the language used for
character encoding is set. This affects the libraries
that Vim was linked with. It's unusual to set this to
a different value from 'encoding' or "C". This sets
$LC_CTYPE.
With the "time" argument the language used for time
and date messages is set. This affects strftime().
This sets $LC_TIME.
With the "collate" argument the language used for the
collation order is set. This affects sorting of
characters. This sets $LC_COLLATE.
Without an argument all are set, and additionally
$LANG is set.
The LC_NUMERIC value will always be set to "C" so
that floating point numbers use '.' as the decimal
point. This will make a difference for items that
depend on the language (some messages, time and date
format).
Not fully supported on all systems.
If this fails there will be an error message. If it
succeeds there is no message. Example: >
:language
Current language: C
:language de_DE.ISO_8859-1
:language mes
Current messages language: de_DE.ISO_8859-1
:lang mes en
<
Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",
where "xx" is the abbreviation of the language (mostly two letters). If you
write your own translations you need to generate the