Movatterモバイル変換


[0]ホーム

URL:


Quick links:help overview ·quick reference ·user manual toc ·reference manual toc·faq
Go to keyword (shortcut:k)
Site search (shortcut:s)
mlang.txt  ForVim version 9.2.  Last change: 2026 Feb 14VIM REFERENCE MANUAL  by Bram MoolenaarMulti-language featuresmultilangmulti-langThisis about usingmessages andmenus invarious languages.  For editingmultibyte text seemultibyte.The basics are explained in the user manual:usr_45.txt.1. Messagesmultilang-messages2. Menusmultilang-menus3. Scriptsmultilang-scriptsAlso seehelp-translated for multi-language help.{not available when compiled without the |+multi_lang| feature}==============================================================================1. Messagesmultilang-messagesVim picks up thelocale from the environment.  In most cases this means Vimwill use the language that you prefer, unless it's not available.To seealist of supportedlocale names on your system, look in one of thesedirectories (for Unix):/usr/lib/locale/usr/share/localeUnfortunately, upper/lowercase differences matter.  Also watch out for theuse of "-" and "_".:lan:lang:languageE197: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 formessagesis printed.  Technical: LC_MESSAGES.With the "ctype" argument the language used forcharacter encodingis printed.  Technical: LC_CTYPE.With the "time" argument the language used forstrftime()is printed.  Technical: LC_TIME.With the "collate" argument the language used forcollation orderis printed.  Technical: LC_COLLATE.Without argument all parts of thelocale are printed(thisis system dependent).The current language can also be obtained with thev:lang,v:ctype,v:collate andv:lc_timevariables.: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 POSIX format of{name} is:language[_territory][.encoding]Thelocale{name}must bea validlocale on yoursystem.  Some systems accept aliases like "en" or"en_US", but some only accept the full specificationlike "en_US.ISO_8859-1".  OnUnix systems you can usethis command to see what locales are supported::!locale -aWith the "messages" argument the language used formessagesis set.  This can be different when you want,for example, Englishmessages while editingJapanesetext.  This sets $LC_MESSAGES.With the "ctype" argument the language used forcharacter encodingis set.  This affects the librariesthat Vim was linked with.  It's unusual to set this toa different value from'encoding' or "C".  This sets$LC_CTYPE.With the "time" argument the language used for timeand datemessagesis set.  This affects strftime().This sets $LC_TIME.With the "collate" argument the language used for thecollation orderis set.  This affectssorting ofcharacters.  This sets $LC_COLLATE.Without an argument all are set, and additionally$LANGis set.If available the LC_NUMERIC value will always be setto "C", so that floating point numbers use '.'as thedecimal point.This will makea difference for items that depend onthe language (some messages, time and date format).Not fully supported on all systemsIf this fails there will be an error message.  Ifitsucceeds thereis no message.  Example::languageCurrent language: C:language de_DE.ISO_8859-1:language mesCurrent messages language: de_DE.ISO_8859-1:lang mes enMS-WINDOWS MESSAGE TRANSLATIONSwin32-gettextIf you used the self-installing .exe file, message translations should workalready.  Otherwise get the libintl.dll file if you don't haveit yet:http://sourceforge.net/projects/gettextOr:https://mlocati.github.io/gettext-iconv-windows/This also contains tools xgettext, msgformat and others.libintl.dll should be placed in same directoryas (g)vim.exe, or one of thedirectories listed in the PATH environment value.  Vim also looks for thealternate names "libintl-8.dll" and "intl.dll".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 .po file andconvertit toa .mo file.  You need to get the sourcedistribution and readthe file "src/po/README.txt".To overrule the automatic choice of the language, set the $LANG variable tothe language of your choice.  use "en" to disable translations.  :let $LANG = 'ja'(text for Windows by Muraoka Taro)==============================================================================2. Menusmultilang-menusSee45.2 for the basics, esp. using'langmenu'.Note that if changes have been made to themenus after the translation wasdone, some of themenus may be shown in English.  Please try contacting themaintainer of the translation and ask him to update it.  You can find thename and e-mail address of the translator in"$VIMRUNTIME/lang/menu_<lang>.vim".To set the font (or fontset) to use for the menus, use the:highlightcommand.  Example::highlight Menu font=k12,r12ALIAS LOCALE NAMESUnfortunately, thelocale names are different onvarious systems, even thoughthey are for the same language and encoding.  If youdo not get the menutranslations you expected, check the output of this command:echo v:langNow check the "$VIMRUNTIME/lang" directory for menu translation files that usea similar language.A difference ina "-" beinga "_" already causesa filenot to be found!  Another common difference to watch out foris "iso8859-1"versus "iso_8859-1".  Fortunately Vim makes all names lowercase, thus youdon't have to worry aboutcase differences.  Spaces are changed tounderscores, to avoid having toescape them.If you finda menu translation file for your language witha different name,createa file in your own runtime directory to load that one.  The name ofthat file could be:~/.vim/lang/menu_<v:lang>.vimCheck the'runtimepath' option for directories which are searched.  In thatfileputa command to load the menu file with the other name:runtime lang/menu_<other_lang>.vimTRANSLATING MENUSIf you want todo your own translations, you can use the:menutrans command,explained below.  Itis recommended toput the translations for one languageina Vim script.  Fora language that has no translation yet, please considerbecoming the maintainer and make your translations available to all Vim users.Send an e-mail to the Vim maintainer <maintainer@vim.org>.:menut:menutrans:menutranslate:menut[ranslate] clearClear all menu translations.:menut[ranslate]{english}{mylang}Translate menu name{english} to{mylang}.  Allspecial characters like "&" and "<Tab>" need to beincluded.  Spaces and dots need to be escaped withabackslash, just like in other:menu commands.Case in{english}is ignored.See the $VIMRUNTIME/lang directory for examples.To try out your translations you first have to remove all menus.  Thisis howyou candoit without restarting Vim::source $VIMRUNTIME/delmenu.vim:source <your-new-menu-file>:source $VIMRUNTIME/menu.vimEach part ofa menu pathis translated separately.  The resultis that when"Help"is translated to "Hilfe" and "Overview" to "Überblick" then"Help.Overview" will be translated to "Hilfe.Überblick".==============================================================================3. Scriptsmultilang-scriptsIn Vim scripts you can use thev:lang variable to get the current language(locale).  The default valueis "C" or comes from the $LANG environmentvariable.The following example shows how this variableis used ina simple way, to makea message adapt to language preferences of the user,:if v:lang =~ "de_DE":  echo "Guten Morgen":else:  echo "Good morning":endif vim:tw=78:sw=4:ts=8:noet:ft=help:norl:

Quick links:help overview ·quick reference ·user manual toc ·reference manual toc·faq


[8]ページ先頭

©2009-2026 Movatter.jp