Home Explore Blog CI



neovim

1st chunk of `runtime/doc/usr_45.txt`
3cea85f5d27784d5f4b1c3d3d19134b5a562807bcd3cb8b70000000100000fa2
*usr_45.txt*	Nvim

		     VIM USER MANUAL - by Bram Moolenaar

			Select your language (locale)


The messages in Vim can be given in several languages.  This chapter explains
how to change which one is used.  Also, the different ways to work with files
in various languages is explained.

|45.1|	Language for Messages
|45.2|	Language for Menus
|45.3|	Using another encoding
|45.4|	Editing files with a different encoding
|45.5|	Entering language text

Previous chapter: |usr_44.txt|  Your own syntax highlighted
Table of contents: |usr_toc.txt|

==============================================================================
*45.1*	Language for Messages

When you start Vim, it checks the environment to find out what language you
are using.  Mostly this should work fine, and you get the messages in your
language (if they are available).  To see what the current language is, use
this command: >

	:language

If it replies with "C", this means the default is being used, which is
English.

What if you would like your messages in a different language?  There are
several ways.  Which one you should use depends on the capabilities of your
system.
   The first way is to set the environment to the desired language before
starting Vim.  Example for Unix: >

	env LANG=de_DE.ISO_8859-1  vim

This only works if the language is available on your system.  The advantage is
that all the GUI messages and things in libraries will use the right language
as well.  A disadvantage is that you must do this before starting Vim.  If you
want to change language while Vim is running, you can use the second method: >

	:language fr_FR.ISO_8859-1

This way you can try out several names for your language.  You will get an
error message when it's not supported on your system.  You don't get an error
when translated messages are not available.  Vim will silently fall back to
using English.
   To find out which languages are supported on your system, find the
directory where they are listed.  On my system it is "/usr/share/locale".  On
some systems it's in "/usr/lib/locale".  The manual page for "setlocale"
should give you a hint where it is found on your system.
   Be careful to type the name exactly as it should be.  Upper and lowercase
matter, and the '-' and '_' characters are easily confused.

You can also set the language separately for messages, edited text and the
time format.  See |:language|.


DO-IT-YOURSELF MESSAGE TRANSLATION

If translated messages are not available for your language, you could write
them yourself.  To do this, get the source code for Vim and the GNU gettext
package.  After unpacking the sources, instructions can be found in the
directory src/po/README.txt.
   It's not too difficult to do the translation.  You don't need to be a
programmer.  You must know both English and the language you are translating
to, of course.
   When you are satisfied with the translation, consider making it available
to others.  Upload it to https://github.com/vim/vim or e-mail it to the Vim
maintainer <maintainer@vim.org>.  Or both.

==============================================================================
*45.2*	Language for Menus

The default menus are in English.  To be able to use your local language, they
must be translated.  Normally this is automatically done for you if the
environment is set for your language, just like with messages.  You don't need
to do anything extra for this.  But it only works if translations for the
language are available.
   Suppose you are in Germany, with the language set to German, but prefer to
use "File" instead of "Datei".  You can switch back to using the English menus
this way: >

	:set langmenu=none

It is also possible to specify a language: >

	:set langmenu=nl_NL.ISO_8859-1

Like above, differences between "-" and "_" matter.  However, upper/lowercase
differences are ignored here.
   The 'langmenu' option must be set before the menus are loaded.  Once the
menus have been defined changing 'langmenu' has no direct

Title: Vim User Manual: Selecting Your Language (Locale)
Summary
This section of the Vim User Manual explains how to change the language used for messages and menus in Vim. It covers setting the language through environment variables or the `:language` command, dealing with different encodings, and even creating your own message translations. It also addresses how to manage the language used in menus.