Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
mlang.txt225 linesDownload Raw Back to doc
1*mlang.txt*	For Vim version 9.2.  Last change: 2026 Feb 142 3 4		  VIM REFERENCE MANUAL	  by Bram Moolenaar5 6 7Multi-language features				*multilang* *multi-lang*8 9This is about using messages and menus in various languages.  For editing10multibyte text see |multibyte|.11 12The basics are explained in the user manual: |usr_45.txt|.13 141. Messages			|multilang-messages|152. Menus			|multilang-menus|163. Scripts			|multilang-scripts|17 18Also see |help-translated| for multi-language help.19 20{not available when compiled without the |+multi_lang| feature}21 22==============================================================================231. Messages						*multilang-messages*24 25Vim picks up the locale from the environment.  In most cases this means Vim26will use the language that you prefer, unless it's not available.27 28To see a list of supported locale names on your system, look in one of these29directories (for Unix):30	/usr/lib/locale ~31	/usr/share/locale ~32Unfortunately, upper/lowercase differences matter.  Also watch out for the33use of "-" and "_".34 35					    *:lan* *:lang* *:language* *E197*36:lan[guage]37:lan[guage] mes[sages]38:lan[guage] cty[pe]39:lan[guage] tim[e]40:lan[guage] col[late]41			Print the current language (aka locale).42			With the "messages" argument the language used for43			messages is printed.  Technical: LC_MESSAGES.44			With the "ctype" argument the language used for45			character encoding is printed.  Technical: LC_CTYPE.46			With the "time" argument the language used for47			strftime() is printed.  Technical: LC_TIME.48			With the "collate" argument the language used for49			collation order is printed.  Technical: LC_COLLATE.50			Without argument all parts of the locale are printed51			(this is system dependent).52			The current language can also be obtained with the53			|v:lang|, |v:ctype|, |v:collate| and |v:lc_time|54			variables.55 56:lan[guage] {name}57:lan[guage] mes[sages] {name}58:lan[guage] cty[pe] {name}59:lan[guage] tim[e] {name}60:lan[guage] col[late] {name}61			Set the current language (aka locale) to {name}.62			The POSIX format of {name} is: >63				language[_territory][.encoding]64<			The locale {name} must be a valid locale on your65			system.  Some systems accept aliases like "en" or66			"en_US", but some only accept the full specification67			like "en_US.ISO_8859-1".  On Unix systems you can use68			this command to see what locales are supported: >69				:!locale -a70<			With the "messages" argument the language used for71			messages is set.  This can be different when you want,72			for example, English messages while editing Japanese73			text.  This sets $LC_MESSAGES.74			With the "ctype" argument the language used for75			character encoding is set.  This affects the libraries76			that Vim was linked with.  It's unusual to set this to77			a different value from 'encoding' or "C".  This sets78			$LC_CTYPE.79			With the "time" argument the language used for time80			and date messages is set.  This affects strftime().81			This sets $LC_TIME.82			With the "collate" argument the language used for the83			collation order is set.  This affects sorting of84			characters.  This sets $LC_COLLATE.85			Without an argument all are set, and additionally86			$LANG is set.87			If available the LC_NUMERIC value will always be set88			to "C", so that floating point numbers use '.' as the89			decimal point.90			This will make a difference for items that depend on91			the language (some messages, time and date format).92			Not fully supported on all systems93			If this fails there will be an error message.  If it94			succeeds there is no message.  Example: >95				:language96				Current language: C97				:language de_DE.ISO_8859-198				:language mes99				Current messages language: de_DE.ISO_8859-1100				:lang mes en101<102 103MS-WINDOWS MESSAGE TRANSLATIONS				*win32-gettext*104 105If you used the self-installing .exe file, message translations should work106already.  Otherwise get the libintl.dll file if you don't have it yet:107 108	http://sourceforge.net/projects/gettext109Or:110	https://mlocati.github.io/gettext-iconv-windows/111 112This also contains tools xgettext, msgformat and others.113 114libintl.dll should be placed in same directory as (g)vim.exe, or one of the115directories listed in the PATH environment value.  Vim also looks for the116alternate names "libintl-8.dll" and "intl.dll".117 118Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",119where "xx" is the abbreviation of the language (mostly two letters).120 121If you write your own translations you need to generate the .po file and122convert it to a .mo file.  You need to get the source distribution and read123the file "src/po/README.txt".124 125To overrule the automatic choice of the language, set the $LANG variable to126the language of your choice.  use "en" to disable translations. >127 128  :let $LANG = 'ja'129 130(text for Windows by Muraoka Taro)131 132==============================================================================1332. Menus						*multilang-menus*134 135See |45.2| for the basics, esp. using 'langmenu'.136 137Note that if changes have been made to the menus after the translation was138done, some of the menus may be shown in English.  Please try contacting the139maintainer of the translation and ask him to update it.  You can find the140name and e-mail address of the translator in141"$VIMRUNTIME/lang/menu_<lang>.vim".142 143To set the font (or fontset) to use for the menus, use the |:highlight|144command.  Example: >145 146	:highlight Menu font=k12,r12147 148 149ALIAS LOCALE NAMES150 151Unfortunately, the locale names are different on various systems, even though152they are for the same language and encoding.  If you do not get the menu153translations you expected, check the output of this command: >154 155	echo v:lang156 157Now check the "$VIMRUNTIME/lang" directory for menu translation files that use158a similar language.  A difference in a "-" being a "_" already causes a file159not to be found!  Another common difference to watch out for is "iso8859-1"160versus "iso_8859-1".  Fortunately Vim makes all names lowercase, thus you161don't have to worry about case differences.  Spaces are changed to162underscores, to avoid having to escape them.163 164If you find a menu translation file for your language with a different name,165create a file in your own runtime directory to load that one.  The name of166that file could be: >167 168	~/.vim/lang/menu_<v:lang>.vim169 170Check the 'runtimepath' option for directories which are searched.  In that171file put a command to load the menu file with the other name: >172 173	runtime lang/menu_<other_lang>.vim174 175 176TRANSLATING MENUS177 178If you want to do your own translations, you can use the |:menutrans| command,179explained below.  It is recommended to put the translations for one language180in a Vim script.  For a language that has no translation yet, please consider181becoming the maintainer and make your translations available to all Vim users.182Send an e-mail to the Vim maintainer <maintainer@vim.org>.183 184					*:menut* *:menutrans* *:menutranslate*185:menut[ranslate] clear186			Clear all menu translations.187 188:menut[ranslate] {english} {mylang}189			Translate menu name {english} to {mylang}.  All190			special characters like "&" and "<Tab>" need to be191			included.  Spaces and dots need to be escaped with a192			backslash, just like in other |:menu| commands.193			Case in {english} is ignored.194 195See the $VIMRUNTIME/lang directory for examples.196 197To try out your translations you first have to remove all menus.  This is how198you can do it without restarting Vim: >199	:source $VIMRUNTIME/delmenu.vim200	:source <your-new-menu-file>201	:source $VIMRUNTIME/menu.vim202 203Each part of a menu path is translated separately.  The result is that when204"Help" is translated to "Hilfe" and "Overview" to "Überblick" then205"Help.Overview" will be translated to "Hilfe.Überblick".206 207==============================================================================2083. Scripts						*multilang-scripts*209 210In Vim scripts you can use the |v:lang| variable to get the current language211(locale).  The default value is "C" or comes from the $LANG environment212variable.213 214The following example shows how this variable is used in a simple way, to make215a message adapt to language preferences of the user, >216 217	:if v:lang =~ "de_DE"218	:  echo "Guten Morgen"219	:else220	:  echo "Good morning"221	:endif222<223 224 vim:tw=78:sw=4:ts=8:noet:ft=help:norl:225 
codekingpro/portable-devtools · Team Ai