Mercurial > vim
annotate runtime/doc/mlang.txt @ 24980:2cb78583fada v8.2.3027
patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Commit: https://github.com/vim/vim/commit/2ac4b2536a40e5cd75b4ff7a3d44a282d2f4f008
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 20 20:09:42 2021 +0200
patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Problem: Vim9: breakpoint in compiled function not always checked.
Solution: Check for breakpoint when calling compiled function from compiled
function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 20 Jun 2021 20:15:02 +0200 |
parents | bbca88cd13d5 |
children | f8116058ca76 |
rev | line source |
---|---|
21991 | 1 *mlang.txt* For Vim version 8.2. Last change: 2020 Aug 15 |
7 | 2 |
3 | |
4 VIM REFERENCE MANUAL by Bram Moolenaar | |
5 | |
6 | |
7 Multi-language features *multilang* *multi-lang* | |
8 | |
9 This is about using messages and menus in various languages. For editing | |
21991 | 10 multibyte text see |multibyte|. |
7 | 11 |
12 The basics are explained in the user manual: |usr_45.txt|. | |
13 | |
14 1. Messages |multilang-messages| | |
15 2. Menus |multilang-menus| | |
16 3. Scripts |multilang-scripts| | |
17 | |
18 Also see |help-translated| for multi-language help. | |
19 | |
20 {not available when compiled without the |+multi_lang| feature} | |
21 | |
22 ============================================================================== | |
23 1. Messages *multilang-messages* | |
24 | |
25 Vim picks up the locale from the environment. In most cases this means Vim | |
26 will use the language that you prefer, unless it's not available. | |
27 | |
28 To see a list of supported locale names on your system, look in one of these | |
29 directories (for Unix): | |
30 /usr/lib/locale ~ | |
31 /usr/share/locale ~ | |
32 Unfortunately, upper/lowercase differences matter. Also watch out for the | |
33 use 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] | |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
40 :lan[guage] col[late] |
7 | 41 Print the current language (aka locale). |
42 With the "messages" argument the language used for | |
43 messages is printed. Technical: LC_MESSAGES. | |
44 With the "ctype" argument the language used for | |
45 character encoding is printed. Technical: LC_CTYPE. | |
46 With the "time" argument the language used for | |
47 strftime() is printed. Technical: LC_TIME. | |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
48 With the "collate" argument the language used for |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
49 collation order is printed. Technical: LC_COLLATE. |
7 | 50 Without argument all parts of the locale are printed |
51 (this is system dependent). | |
52 The current language can also be obtained with the | |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
53 |v:lang|, |v:ctype|, |v:collate| and |v:lc_time| |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
54 variables. |
7 | 55 |
56 :lan[guage] {name} | |
57 :lan[guage] mes[sages] {name} | |
58 :lan[guage] cty[pe] {name} | |
59 :lan[guage] tim[e] {name} | |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
60 :lan[guage] col[late] {name} |
7 | 61 Set the current language (aka locale) to {name}. |
62 The locale {name} must be a valid locale on your | |
63 system. Some systems accept aliases like "en" or | |
64 "en_US", but some only accept the full specification | |
2348
8878a9f8db87
Rename w_p_conceal to w_p_conc for consistency.
Bram Moolenaar <bram@vim.org>
parents:
2345
diff
changeset
|
65 like "en_US.ISO_8859-1". On Unix systems you can use |
3281 | 66 this command to see what locales are supported: > |
2348
8878a9f8db87
Rename w_p_conceal to w_p_conc for consistency.
Bram Moolenaar <bram@vim.org>
parents:
2345
diff
changeset
|
67 :!locale -a |
8878a9f8db87
Rename w_p_conceal to w_p_conc for consistency.
Bram Moolenaar <bram@vim.org>
parents:
2345
diff
changeset
|
68 < With the "messages" argument the language used for |
7 | 69 messages is set. This can be different when you want, |
70 for example, English messages while editing Japanese | |
71 text. This sets $LC_MESSAGES. | |
72 With the "ctype" argument the language used for | |
73 character encoding is set. This affects the libraries | |
74 that Vim was linked with. It's unusual to set this to | |
2681 | 75 a different value from 'encoding' or "C". This sets |
7 | 76 $LC_CTYPE. |
77 With the "time" argument the language used for time | |
78 and date messages is set. This affects strftime(). | |
79 This sets $LC_TIME. | |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
80 With the "collate" argument the language used for the |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
81 collation order is set. This affects sorting of |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
82 characters. This sets $LC_COLLATE. |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
83 Without an argument all are set, and additionally |
7 | 84 $LANG is set. |
1619 | 85 When compiled with the |+float| feature the LC_NUMERIC |
86 value will always be set to "C", so that floating | |
87 point numbers use '.' as the decimal point. | |
7 | 88 This will make a difference for items that depend on |
89 the language (some messages, time and date format). | |
90 Not fully supported on all systems | |
91 If this fails there will be an error message. If it | |
92 succeeds there is no message. Example: > | |
93 :language | |
94 Current language: C | |
95 :language de_DE.ISO_8859-1 | |
96 :language mes | |
97 Current messages language: de_DE.ISO_8859-1 | |
98 :lang mes en | |
99 < | |
100 | |
101 MS-WINDOWS MESSAGE TRANSLATIONS *win32-gettext* | |
102 | |
103 If you used the self-installing .exe file, message translations should work | |
104 already. Otherwise get the libintl.dll file if you don't have it yet: | |
105 | |
106 http://sourceforge.net/projects/gettext | |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
5294
diff
changeset
|
107 Or: |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
5294
diff
changeset
|
108 https://mlocati.github.io/gettext-iconv-windows/ |
7 | 109 |
110 This also contains tools xgettext, msgformat and others. | |
111 | |
14881
35aff6b8a2c7
patch 8.1.0452: MS-Windows: not finding intl.dll
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
112 libintl.dll should be placed in same directory as (g)vim.exe, or one of the |
35aff6b8a2c7
patch 8.1.0452: MS-Windows: not finding intl.dll
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
113 directories listed in the PATH environment value. Vim also looks for the |
35aff6b8a2c7
patch 8.1.0452: MS-Windows: not finding intl.dll
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
114 alternate names "libintl-8.dll" and "intl.dll". |
35aff6b8a2c7
patch 8.1.0452: MS-Windows: not finding intl.dll
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
115 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
5294
diff
changeset
|
116 Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES", |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
5294
diff
changeset
|
117 where "xx" is the abbreviation of the language (mostly two letters). |
7 | 118 |
119 If you write your own translations you need to generate the .po file and | |
120 convert it to a .mo file. You need to get the source distribution and read | |
121 the file "src/po/README.txt". | |
122 | |
123 To overrule the automatic choice of the language, set the $LANG variable to | |
124 the language of your choice. use "en" to disable translations. > | |
125 | |
126 :let $LANG = 'ja' | |
127 | |
128 (text for Windows by Muraoka Taro) | |
129 | |
130 ============================================================================== | |
131 2. Menus *multilang-menus* | |
132 | |
1121 | 133 See |45.2| for the basics, esp. using 'langmenu'. |
7 | 134 |
135 Note that if changes have been made to the menus after the translation was | |
136 done, some of the menus may be shown in English. Please try contacting the | |
137 maintainer of the translation and ask him to update it. You can find the | |
138 name and e-mail address of the translator in | |
139 "$VIMRUNTIME/lang/menu_<lang>.vim". | |
140 | |
141 To set the font (or fontset) to use for the menus, use the |:highlight| | |
142 command. Example: > | |
143 | |
144 :highlight Menu font=k12,r12 | |
145 | |
146 | |
147 ALIAS LOCALE NAMES | |
148 | |
149 Unfortunately, the locale names are different on various systems, even though | |
150 they are for the same language and encoding. If you do not get the menu | |
151 translations you expected, check the output of this command: > | |
152 | |
153 echo v:lang | |
154 | |
155 Now check the "$VIMRUNTIME/lang" directory for menu translation files that use | |
156 a similar language. A difference in a "-" being a "_" already causes a file | |
157 not to be found! Another common difference to watch out for is "iso8859-1" | |
158 versus "iso_8859-1". Fortunately Vim makes all names lowercase, thus you | |
159 don't have to worry about case differences. Spaces are changed to | |
160 underscores, to avoid having to escape them. | |
161 | |
162 If you find a menu translation file for your language with a different name, | |
163 create a file in your own runtime directory to load that one. The name of | |
164 that file could be: > | |
165 | |
166 ~/.vim/lang/menu_<v:lang>.vim | |
167 | |
168 Check the 'runtimepath' option for directories which are searched. In that | |
169 file put a command to load the menu file with the other name: > | |
170 | |
171 runtime lang/menu_<other_lang>.vim | |
172 | |
173 | |
174 TRANSLATING MENUS | |
175 | |
176 If you want to do your own translations, you can use the |:menutrans| command, | |
177 explained below. It is recommended to put the translations for one language | |
178 in a Vim script. For a language that has no translation yet, please consider | |
179 becoming the maintainer and make your translations available to all Vim users. | |
180 Send an e-mail to the Vim maintainer <maintainer@vim.org>. | |
181 | |
182 *:menut* *:menutrans* *:menutranslate* | |
183 :menut[ranslate] clear | |
184 Clear all menu translations. | |
185 | |
186 :menut[ranslate] {english} {mylang} | |
187 Translate menu name {english} to {mylang}. All | |
188 special characters like "&" and "<Tab>" need to be | |
189 included. Spaces and dots need to be escaped with a | |
190 backslash, just like in other |:menu| commands. | |
11062 | 191 Case in {english} is ignored. |
7 | 192 |
193 See the $VIMRUNTIME/lang directory for examples. | |
194 | |
195 To try out your translations you first have to remove all menus. This is how | |
196 you can do it without restarting Vim: > | |
197 :source $VIMRUNTIME/delmenu.vim | |
198 :source <your-new-menu-file> | |
199 :source $VIMRUNTIME/menu.vim | |
200 | |
201 Each part of a menu path is translated separately. The result is that when | |
13857 | 202 "Help" is translated to "Hilfe" and "Overview" to "Überblick" then |
203 "Help.Overview" will be translated to "Hilfe.Überblick". | |
7 | 204 |
205 ============================================================================== | |
206 3. Scripts *multilang-scripts* | |
207 | |
208 In Vim scripts you can use the |v:lang| variable to get the current language | |
209 (locale). The default value is "C" or comes from the $LANG environment | |
210 variable. | |
211 | |
212 The following example shows how this variable is used in a simple way, to make | |
213 a message adapt to language preferences of the user, > | |
214 | |
215 :if v:lang =~ "de_DE" | |
216 : echo "Guten Morgen" | |
217 :else | |
218 : echo "Good morning" | |
219 :endif | |
220 < | |
221 | |
14421 | 222 vim:tw=78:sw=4:ts=8:noet:ft=help:norl: |