代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>mlang - Vim Documentation</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.0">
<meta name="syntax" content="help">
<meta name="settings" content="no_pre,use_css,expand_tabs">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="mark-current-page.js" type="text/javascript"></script>
</head>
<body>
<header>
<div class="header">
<a href="http://vim-jp.org/">vim-jp</a>
/ <a href="http://vim-jp.org/vimdoc-en/">vimdoc-en</a>
/ mlang<br />
<a name="top"></a><h1>mlang - Vim Documentation</h1>
<a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
</div>
</header>
<nav>
<dl>
<dt>BASIC</dt>
<dd><ul>
<li><a href="quickref.html">quickref</a></li>
<li><a href="sponsor.html">sponsor</a></li>
</ul></dd>
<dt>USER MANUAL</dt>
<dd><ul>
<li><a href="usr_toc.html">usr_toc</a></li>
</ul></dd>
<dt>Getting Started</dt>
<dd><ul>
<li><a href="usr_01.html">usr_01</a></li>
<li><a href="usr_02.html">usr_02</a></li>
<li><a href="usr_03.html">usr_03</a></li>
<li><a href="usr_04.html">usr_04</a></li>
<li><a href="usr_05.html">usr_05</a></li>
<li><a href="usr_06.html">usr_06</a></li>
<li><a href="usr_07.html">usr_07</a></li>
<li><a href="usr_08.html">usr_08</a></li>
<li><a href="usr_09.html">usr_09</a></li>
<li><a href="usr_10.html">usr_10</a></li>
<li><a href="usr_11.html">usr_11</a></li>
<li><a href="usr_12.html">usr_12</a></li>
</ul></dd>
<dt>Editing Effectively</dt>
<dd><ul>
<li><a href="usr_20.html">usr_20</a></li>
<li><a href="usr_21.html">usr_21</a></li>
<li><a href="usr_22.html">usr_22</a></li>
<li><a href="usr_23.html">usr_23</a></li>
<li><a href="usr_24.html">usr_24</a></li>
<li><a href="usr_25.html">usr_25</a></li>
<li><a href="usr_26.html">usr_26</a></li>
<li><a href="usr_27.html">usr_27</a></li>
<li><a href="usr_28.html">usr_28</a></li>
<li><a href="usr_29.html">usr_29</a></li>
<li><a href="usr_30.html">usr_30</a></li>
<li><a href="usr_31.html">usr_31</a></li>
<li><a href="usr_32.html">usr_32</a></li>
</ul></dd>
<dt>Tuning Vim</dt>
<dd><ul>
<li><a href="usr_40.html">usr_40</a></li>
<li><a href="usr_41.html">usr_41</a></li>
<li><a href="usr_42.html">usr_42</a></li>
<li><a href="usr_43.html">usr_43</a></li>
<li><a href="usr_44.html">usr_44</a></li>
<li><a href="usr_45.html">usr_45</a></li>
</ul></dd>
<dt>Making Vim Run</dt>
<dd><ul>
<li><a href="usr_90.html">usr_90</a></li>
</ul></dd>
<dt>General subjects</dt>
<dd><ul>
<li><a href="intro.html">intro</a></li>
<li><a href="index.html">help</a></li>
<li><a href="helphelp.html">helphelp</a></li>
<li><a href="vimindex.html">index</a></li>
<li><a href="tags.html">tags</a></li>
<li><a href="howto.html">howto</a></li>
<li><a href="tips.html">tips</a></li>
<li><a href="message.html">message</a></li>
<li><a href="quotes.html">quotes</a></li>
<li><a href="todo.html">todo</a></li>
<li><a href="debug.html">debug</a></li>
<li><a href="develop.html">develop</a></li>
<li><a href="uganda.html">uganda</a></li>
</ul></dd>
<dt>Basic editing</dt>
<dd><ul>
<li><a href="starting.html">starting</a></li>
<li><a href="editing.html">editing</a></li>
<li><a href="motion.html">motion</a></li>
<li><a href="scroll.html">scroll</a></li>
<li><a href="insert.html">insert</a></li>
<li><a href="change.html">change</a></li>
<li><a href="indent.html">indent</a></li>
<li><a href="undo.html">undo</a></li>
<li><a href="repeat.html">repeat</a></li>
<li><a href="visual.html">visual</a></li>
<li><a href="various.html">various</a></li>
<li><a href="recover.html">recover</a></li>
</ul></dd>
<dt>Advanced editing</dt>
<dd><ul>
<li><a href="cmdline.html">cmdline</a></li>
<li><a href="options.html">options</a></li>
<li><a href="pattern.html">pattern</a></li>
<li><a href="map.html">map</a></li>
<li><a href="tagsrch.html">tagsrch</a></li>
<li><a href="quickfix.html">quickfix</a></li>
<li><a href="windows.html">windows</a></li>
<li><a href="tabpage.html">tabpage</a></li>
<li><a href="syntax.html">syntax</a></li>
<li><a href="spell.html">spell</a></li>
<li><a href="diff.html">diff</a></li>
<li><a href="autocmd.html">autocmd</a></li>
<li><a href="filetype.html">filetype</a></li>
<li><a href="eval.html">eval</a></li>
<li><a href="channel.html">channel</a></li>
<li><a href="fold.html">fold</a></li>
</ul></dd>
<dt>Special issues</dt>
<dd><ul>
<li><a href="print.html">print</a></li>
<li><a href="remote.html">remote</a></li>
<li><a href="term.html">term</a></li>
<li><a href="digraph.html">digraph</a></li>
<li><a href="mbyte.html">mbyte</a></li>
<li><a href="mlang.html">mlang</a></li>
<li><a href="arabic.html">arabic</a></li>
<li><a href="farsi.html">farsi</a></li>
<li><a href="hebrew.html">hebrew</a></li>
<li><a href="russian.html">russian</a></li>
<li><a href="ft_ada.html">ft_ada</a></li>
<li><a href="ft_sql.html">ft_sql</a></li>
<li><a href="hangulin.html">hangulin</a></li>
<li><a href="rileft.html">rileft</a></li>
</ul></dd>
<dt>GUI</dt>
<dd><ul>
<li><a href="gui.html">gui</a></li>
<li><a href="gui_w32.html">gui_w32</a></li>
<li><a href="gui_x11.html">gui_x11</a></li>
</ul></dd>
<dt>Interfaces</dt>
<dd><ul>
<li><a href="if_cscop.html">if_cscop</a></li>
<li><a href="if_lua.html">if_lua</a></li>
<li><a href="if_mzsch.html">if_mzsch</a></li>
<li><a href="if_perl.html">if_perl</a></li>
<li><a href="if_pyth.html">if_pyth</a></li>
<li><a href="if_tcl.html">if_tcl</a></li>
<li><a href="if_ole.html">if_ole</a></li>
<li><a href="if_ruby.html">if_ruby</a></li>
<li><a href="debugger.html">debugger</a></li>
<li><a href="workshop.html">workshop</a></li>
<li><a href="netbeans.html">netbeans</a></li>
<li><a href="sign.html">sign</a></li>
</ul></dd>
<dt>Versions</dt>
<dd><ul>
<li><a href="vi_diff.html">vi_diff</a></li>
<li><a href="version4.html">version4</a></li>
<li><a href="version5.html">version5</a></li>
<li><a href="version6.html">version6</a></li>
<li><a href="version7.html">version7</a></li>
<li><a href="version8.html">version8</a></li>
</ul></dd>
<dt>Remarks about specific systems</dt>
<dd><ul>
<li><a href="os_390.html">os_390</a></li>
<li><a href="os_amiga.html">os_amiga</a></li>
<li><a href="os_beos.html">os_beos</a></li>
<li><a href="os_dos.html">os_dos</a></li>
<li><a href="os_mac.html">os_mac</a></li>
<li><a href="os_mint.html">os_mint</a></li>
<li><a href="os_msdos.html">os_msdos</a></li>
<li><a href="os_os2.html">os_os2</a></li>
<li><a href="os_qnx.html">os_qnx</a></li>
<li><a href="os_risc.html">os_risc</a></li>
<li><a href="os_unix.html">os_unix</a></li>
<li><a href="os_vms.html">os_vms</a></li>
<li><a href="os_win32.html">os_win32</a></li>
</ul></dd>
<dt>Standard plugins</dt>
<dd><ul>
<li><a href="pi_getscript.html">pi_getscript</a></li>
<li><a href="pi_gzip.html">pi_gzip</a></li>
<li><a href="pi_logipat.html">pi_logipat</a></li>
<li><a href="pi_netrw.html">pi_netrw</a></li>
<li><a href="pi_paren.html">pi_paren</a></li>
<li><a href="pi_tar.html">pi_tar</a></li>
<li><a href="pi_vimball.html">pi_vimball</a></li>
<li><a href="pi_zip.html">pi_zip</a></li>
</ul></dd>
<dt>Filetype plugins</dt>
<dd><ul>
<li><a href="pi_spec.html">pi_spec</a></li>
</ul></dd>
<dt>Others</dt>
<dd><ul>
<li><a href="vim_faq.html">vim_faq</a></li>
</ul></dd>
</dl>
</nav>
<article class="Vimdoc VimdocJa">
<div id='vimCodeElement'>
<a class="Constant" href="mlang.html" name="mlang.txt">mlang.txt</a> For <span class="Identifier">Vim version 8.0.</span> Last change: 2017 Mar 04<br>
<br>
<br>
<span class="Identifier">VIM REFERENCE MANUAL by Bram Moolenaar</span><br>
<br>
<br>
Multi-language features <a class="Constant" href="mlang.html#multilang" name="multilang">multilang</a> <a class="Constant" href="mlang.html#multi-lang" name="multi-lang">multi-lang</a><br>
<br>
This is about using messages and menus in various languages. For editing<br>
multi-byte text see <a class="Identifier" href="mbyte.html#multibyte">multibyte</a>.<br>
<br>
The basics are explained in the user manual: <a class="Identifier" href="usr_45.html">usr_45.txt</a>.<br>
<br>
1. Messages <a class="Identifier" href="mlang.html#multilang-messages">multilang-messages</a><br>
2. Menus <a class="Identifier" href="mlang.html#multilang-menus">multilang-menus</a><br>
3. Scripts <a class="Identifier" href="mlang.html#multilang-scripts">multilang-scripts</a><br>
<br>
Also see <a class="Identifier" href="helphelp.html#help-translated">help-translated</a> for multi-language help.<br>
<br>
<span class="Special">{Vi does not have any of these features}</span><br>
<span class="Special">{not available when compiled without the </span><a class="Identifier" href="various.html#+multi_lang">+multi_lang</a><span class="Special"> feature}</span><br>
<br>
<span class="PreProc">==============================================================================</span><br>
1. Messages <a class="Constant" href="mlang.html#multilang-messages" name="multilang-messages">multilang-messages</a><br>
<br>
Vim picks up the locale from the environment. In most cases this means Vim<br>
will use the language that you prefer, unless it's not available.<br>
<br>
To see a list of supported locale names on your system, look in one of these<br>
directories (for Unix):<br>
<span class="PreProc">/usr/lib/locale</span><br>
<span class="PreProc">/usr/share/locale</span><br>
Unfortunately, upper/lowercase differences matter. Also watch out for the<br>
use of "-" and "_".<br>
<br>
<a class="Constant" href="mlang.html#:lan" name=":lan">:lan</a> <a class="Constant" href="mlang.html#:lang" name=":lang">:lang</a> <a class="Constant" href="mlang.html#:language" name=":language">:language</a> <a class="Constant" href="mlang.html#E197" name="E197">E197</a><br>
:lan[guage]<br>
:lan[guage] mes[sages]<br>
:lan[guage] cty[pe]<br>
:lan[guage] tim[e]<br>
Print the current language (aka locale).<br>
With the "messages" argument the language used for<br>
messages is printed. Technical: LC_MESSAGES.<br>
With the "ctype" argument the language used for<br>
character encoding is printed. Technical: LC_CTYPE.<br>
With the "time" argument the language used for<br>
strftime() is printed. Technical: LC_TIME.<br>
Without argument all parts of the locale are printed<br>
(this is system dependent).<br>
The current language can also be obtained with the<br>
<a class="Identifier" href="eval.html#v:lang">v:lang</a>, <a class="Identifier" href="eval.html#v:ctype">v:ctype</a> and <a class="Identifier" href="eval.html#v:lc_time">v:lc_time</a> variables.<br>
<br>
:lan[guage] <span class="Special">{name}</span><br>
:lan[guage] mes[sages] <span class="Special">{name}</span><br>
:lan[guage] cty[pe] <span class="Special">{name}</span><br>
:lan[guage] tim[e] <span class="Special">{name}</span><br>
Set the current language (aka locale) to <span class="Special">{name}</span>.<br>
The locale <span class="Special">{name}</span> must be a valid locale on your<br>
system. Some systems accept aliases like "en" or<br>
"en_US", but some only accept the full specification<br>
like "en_US.ISO_8859-1". On Unix systems you can use<br>
this command to see what locales are supported:<br>
<div class="helpExample"> :!locale -a</div>
With the "messages" argument the language used for<br>
messages is set. This can be different when you want,<br>
for example, English messages while editing Japanese<br>
text. This sets $LC_MESSAGES.<br>
With the "ctype" argument the language used for<br>
character encoding is set. This affects the libraries<br>
that Vim was linked with. It's unusual to set this to<br>
a different value from <a class="Type" href="options.html#'encoding'">'encoding'</a> or "C". This sets<br>
$LC_CTYPE.<br>
With the "time" argument the language used for time<br>
and date messages is set. This affects strftime().<br>
This sets $LC_TIME.<br>
Without an argument both are set, and additionally<br>
$LANG is set.<br>
When compiled with the <a class="Identifier" href="various.html#+float">+float</a> feature the LC_NUMERIC<br>
value will always be set to "C", so that floating<br>
point numbers use '.' as the decimal point.<br>
This will make a difference for items that depend on<br>
the language (some messages, time and date format).<br>
Not fully supported on all systems<br>
If this fails there will be an error message. If it<br>
succeeds there is no message. Example:<br>
<div class="helpExample"> :language<br>
Current language: C<br>
:language de_DE.ISO_8859-1<br>
:language mes<br>
Current messages language: de_DE.ISO_8859-1<br>
:lang mes en</div>
<br>
<br>
<span class="Statement">MS-WINDOWS MESSAGE TRANSLATIONS </span><a class="Constant" href="mlang.html#win32-gettext" name="win32-gettext">win32-gettext</a><br>
<br>
If you used the self-installing .exe file, message translations should work<br>
already. Otherwise get the libintl.dll file if you don't have it yet:<br>
<br>
<span class="Constant"><a href="http://sourceforge.net/projects/gettext">http://sourceforge.net/projects/gettext</a></span><br>
Or:<br>
<span class="Constant"><a href="https://mlocati.github.io/gettext-iconv-windows/">https://mlocati.github.io/gettext-iconv-windows/</a></span><br>
<br>
This also contains tools xgettext, msgformat and others.<br>
<br>
libintl.dll should be placed in same directory with (g)vim.exe, or some<br>
place where PATH environment value describe. Vim also finds libintl-8.dll.<br>
Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",<br>
where "xx" is the abbreviation of the language (mostly two letters).<br>
<br>
If you write your own translations you need to generate the .po file and<br>
convert it to a .mo file. You need to get the source distribution and read<br>
the file "src/po/README.txt".<br>
<br>
To overrule the automatic choice of the language, set the $LANG variable to<br>
the language of your choice. use "en" to disable translations.<br>
<br>
<div class="helpExample"> :let $LANG = 'ja'</div>
<br>
(text for Windows by Muraoka Taro)<br>
<br>
<span class="PreProc">==============================================================================</span><br>
2. Menus <a class="Constant" href="mlang.html#multilang-menus" name="multilang-menus">multilang-menus</a><br>
<br>
See <a class="Identifier" href="usr_45.html#45.2">45.2</a> for the basics, esp. using <a class="Type" href="options.html#'langmenu'">'langmenu'</a>.<br>
<br>
<span class="Todo">Note</span> that if changes have been made to the menus after the translation was<br>
done, some of the menus may be shown in English. Please try contacting the<br>
maintainer of the translation and ask him to update it. You can find the<br>
name and e-mail address of the translator in<br>
"$VIMRUNTIME/lang/menu_<span class="Special"><lang></span>.vim".<br>
<br>
To set the font (or fontset) to use for the menus, use the <a class="Identifier" href="syntax.html#:highlight">:highlight</a><br>
command. Example:<br>
<br>
<div class="helpExample"> :highlight Menu font=k12,r12</div>
<br>
<br>
ALIAS LOCALE NAMES<br>
<br>
Unfortunately, the locale names are different on various systems, even though<br>
they are for the same language and encoding. If you do not get the menu<br>
translations you expected, check the output of this command:<br>
<br>
<div class="helpExample"> echo v:lang</div>
<br>
Now check the "$VIMRUNTIME/lang" directory for menu translation files that use<br>
a similar language. A difference in a "-" being a "_" already causes a file<br>
not to be found! Another common difference to watch out for is "iso8859-1"<br>
versus "iso_8859-1". Fortunately Vim makes all names lowercase, thus you<br>
don't have to worry about case differences. Spaces are changed to<br>
underscores, to avoid having to escape them.<br>
<br>
If you find a menu translation file for your language with a different name,<br>
create a file in your own runtime directory to load that one. The name of<br>
that file could be:<br>
<br>
<div class="helpExample"> ~/.vim/lang/menu_<v:lang>.vim</div>
<br>
Check the <a class="Type" href="options.html#'runtimepath'">'runtimepath'</a> option for directories which are searched. In that<br>
file put a command to load the menu file with the other name:<br>
<br>
<div class="helpExample"> runtime lang/menu_<other_lang>.vim</div>
<br>
<br>
TRANSLATING MENUS<br>
<br>
If you want to do your own translations, you can use the <a class="Identifier" href="mlang.html#:menutrans">:menutrans</a> command,<br>
explained below. It is recommended to put the translations for one language<br>
in a Vim script. For a language that has no translation yet, please consider<br>
becoming the maintainer and make your translations available to all Vim users.<br>
Send an e-mail to the Vim maintainer <maintainer@vim.org>.<br>
<br>
<a class="Constant" href="mlang.html#:menut" name=":menut">:menut</a> <a class="Constant" href="mlang.html#:menutrans" name=":menutrans">:menutrans</a> <a class="Constant" href="mlang.html#:menutranslate" name=":menutranslate">:menutranslate</a><br>
:menut[ranslate] clear<br>
Clear all menu translations.<br>
<br>
:menut[ranslate] <span class="Special">{english}</span> <span class="Special">{mylang}</span><br>
Translate menu name <span class="Special">{english}</span> to <span class="Special">{mylang}</span>. All<br>
special characters like "&" and "<span class="Special"><Tab></span>" need to be<br>
included. Spaces and dots need to be escaped with a<br>
backslash, just like in other <a class="Identifier" href="gui.html#:menu">:menu</a> commands.<br>
Case in <span class="Special">{english}</span> is ignored.<br>
<br>
See the $VIMRUNTIME/lang directory for examples.<br>
<br>
To try out your translations you first have to remove all menus. This is how<br>
you can do it without restarting Vim:<br>
<div class="helpExample"> :source $VIMRUNTIME/delmenu.vim<br>
:source <your-new-menu-file><br>
:source $VIMRUNTIME/menu.vim</div>
<br>
Each part of a menu path is translated separately. The result is that when<br>
"Help" is translated to "Hilfe" and "Overview" to "?berblick" then<br>
"Help.Overview" will be translated to "Hilfe.?berblick".<br>
<br>
<span class="PreProc">==============================================================================</span><br>
3. Scripts <a class="Constant" href="mlang.html#multilang-scripts" name="multilang-scripts">multilang-scripts</a><br>
<br>
In Vim scripts you can use the <a class="Identifier" href="eval.html#v:lang">v:lang</a> variable to get the current language<br>
(locale). The default value is "C" or comes from the $LANG environment<br>
variable.<br>
<br>
The following example shows how this variable is used in a simple way, to make<br>
a message adapt to language preferences of the user,<br>
<br>
<div class="helpExample"> :if v:lang =~ "de_DE"<br>
: echo "Guten Morgen"<br>
:else<br>
: echo "Good morning"<br>
:endif</div>
<br>
<br>
vim:tw=78:sw=4:ts=8:ft=help:norl:<br>
</div>
</article>
<footer>
<a href="#top">Return to the top</a> - <a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
<br />
<div style="text-align:right;">
Hosted by <a href="https://github.com/vim-jp/vimdoc-en">vimdoc-en project</a><br />
If you met any problem, please report it to <a href="https://github.com/vim-jp/vimdoc-en/issues">issue</a>.<br />
</div>
</footer>
<!--<script src="js/check-referrer.js" type="text/javascript"></script>-->
</body>
</html>
<!-- vim:set ts=8 sts=2 sw=2 tw=0 et: -->
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。