Mercurial > vim
annotate src/po/README.txt @ 31584:cfc60c536a2f v9.0.1124
patch 9.0.1124: virtual text at a column position is truncated
Commit: https://github.com/vim/vim/commit/1aeb3eb092a384e63a407096102fd5a954aabeb8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 1 14:04:51 2023 +0000
patch 9.0.1124: virtual text at a column position is truncated
Problem: Virtual text at a column position is truncated at the window edge.
(Yegappan Lakshmanan)
Solution: Do not truncated virtual text that is placed at a column.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 01 Jan 2023 15:15:03 +0100 |
parents | 729a7c00fabc |
children | 4027cefc2aab |
rev | line source |
---|---|
7 | 1 TRANSLATING VIM MESSAGES |
2 | |
3 In this directory you will find xx.po files, where "xx" is a language code. | |
4 Each file contains the translation of English Vim messages for one language. | |
5 The files are in "po" format, used by the gettext package. Please refer to | |
6 the gettext documentation for more information. | |
7 | |
8 The GNU gettext library, starting with version 0.10.37, supports converting | |
9 messages from one encoding to another. This requires that it was compiled | |
10 with HAVE_ICONV. The result is that the messages may be in any encoding | |
11 supported by iconv and will be automatically converted to the currently used | |
12 encoding. | |
13 | |
14 The GNU gettext library, starting with version 0.10.36, uses a new format for | |
1125 | 15 some encodings. This follows the C99 standard for strings. It means that |
16 when a multi-byte character includes the 0x5c byte, this is not recognized as | |
17 a backslash. Since this format is incompatible with Solaris, Vim uses the old | |
7 | 18 format. This is done by setting the OLD_PO_FILE_OUTPUT and OLD_PO_FILE_INPUT |
19 environment variables. When you use the Makefile in this directory that will | |
20 be done for you. This does NOT work with gettext 0.10.36. Don't use it, get | |
21 0.10.37. | |
22 | |
29285 | 23 Have a look at these helper scripts, they may be useful for you: |
24 https://github.com/adaext/vim-menutrans-helper | |
25 | |
7 | 26 |
27 ON MS-WINDOWS | |
28 | |
29 The distributed files are generated on Unix, but this should also be possible | |
30 on MS-Windows. Download the gettext packages, for example from: | |
31 | |
32 http://sourceforge.net/projects/gettext | |
33 | |
34 You might have to do the commands manually. Example: | |
35 | |
16023 | 36 cd c:\vim\vim81 |
7 | 37 mkdir runtime\lang\ja\LC_MESSAGES |
38 msgfmt -o runtime\lang\ja\LC_MESSAGES\vim.mo src\po\ja.po | |
39 | |
40 | |
41 WHEN THERE IS A MISTAKE | |
42 | |
43 If you find there is a mistake in one of the translations, please report this | |
44 to the maintainer of the translation. His/her E-mail address is in the | |
45 comments at the start of the file. You can also see this with the ":messages" | |
46 command in Vim when the translation is being used. | |
47 | |
48 | |
49 CREATING A NEW PO FILE | |
50 | |
51 We will use "xx.po" as an example here, replace "xx" with the name of your | |
52 language. | |
53 | |
54 - Edit Makefile to add xx to LANGUAGES and xx.mo to MOFILES. | |
14123 | 55 - If you haven't done so already, run ./configure in the top vim directory |
56 (i.e. go up two directories) and then come back here afterwards. | |
57 - Execute these commands: | |
58 % make vim.pot | |
59 % msginit -l xx | |
60 % rm vim.pot | |
61 The first command will generate a vim.pot file which is used by msginit to | |
62 generate a correct xx.po file. After that vim.pot is not needed. | |
7 | 63 - The remaining work is like updating, see the next section. |
64 | |
65 | |
66 UPDATING A PO FILE | |
67 | |
68 If you are the maintainer of a .po file, this is how you update the file. We | |
69 will use "xx.po" as an example here, replace "xx" with the name of your | |
70 language. | |
71 | |
72 (1) Add new and changed messages from the Vim sources: | |
73 | |
74 make xx | |
75 | |
76 This will extract all the strings from Vim and merge them in with the | |
4992 | 77 existing translations. Requires the GNU gettext utilities. |
7 | 78 Your original xx.po file will be copied to xx.po.orig |
79 | |
80 -- After you do this, you MUST do the next three steps! -- | |
81 | |
82 (2) Translate | |
83 See the gettext documentation on how to do this. You can also find | |
21989
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
84 examples in the other po files. You can use "gF" on the file name to see |
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
85 the context of the message. |
7 | 86 Search the po file for items that require translation: |
87 | |
88 /fuzzy\|^msgstr ""\(\n"\)\@! | |
89 | |
90 Remove the "#, fuzzy" line after adding the translation. | |
91 | |
92 There is one special message: | |
93 msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" | |
94 You should include your name and E-mail address instead, for example: | |
95 msgstr "Berichten übersetzt bei: John Doe <john@doe.org>" | |
96 | |
11900
39e46ae74c69
patch 8.0.0830: translating messages is not ideal
Christian Brabandt <cb@256bit.org>
parents:
11659
diff
changeset
|
97 (3) Remove unused messages (optional) |
22071
aa91480771fe
patch 8.2.1585: messages in globals.h not translated
Bram Moolenaar <Bram@vim.org>
parents:
21989
diff
changeset
|
98 Remove messages that have been marked as obsolete. |
11900
39e46ae74c69
patch 8.0.0830: translating messages is not ideal
Christian Brabandt <cb@256bit.org>
parents:
11659
diff
changeset
|
99 Such messages start with "#~". |
39e46ae74c69
patch 8.0.0830: translating messages is not ideal
Christian Brabandt <cb@256bit.org>
parents:
11659
diff
changeset
|
100 |
39e46ae74c69
patch 8.0.0830: translating messages is not ideal
Christian Brabandt <cb@256bit.org>
parents:
11659
diff
changeset
|
101 The cleanup script will also do that (see next step). |
39e46ae74c69
patch 8.0.0830: translating messages is not ideal
Christian Brabandt <cb@256bit.org>
parents:
11659
diff
changeset
|
102 |
39e46ae74c69
patch 8.0.0830: translating messages is not ideal
Christian Brabandt <cb@256bit.org>
parents:
11659
diff
changeset
|
103 (4) Clean up |
7 | 104 This is very important to make sure the translation works on all systems. |
105 Comment-out all non-translated strings. There are two types: | |
106 - items marked with "#, fuzzy" | |
107 - items with an empty msgstr | |
108 You can do this with the cleanup.vim script: | |
109 | |
110 :source cleanup.vim | |
111 | |
112 Background: on Solaris an empty msgstr results in an empty message; GNU | |
113 gettext ignores empty strings and items marked with "#, fuzzy". | |
114 | |
449 | 115 This also removes the line numbers from the file, so that patches are not |
116 messed up by changes in line numbers and show the actual changes in the | |
117 text. | |
118 | |
11914 | 119 (5) Check: |
7 | 120 |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
4992
diff
changeset
|
121 While editing the .po file: |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
4992
diff
changeset
|
122 :source check.vim |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
4992
diff
changeset
|
123 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
4992
diff
changeset
|
124 From the command line: |
440 | 125 vim -S check.vim xx.po |
7 | 126 make xx.mo |
127 | |
128 Look out for syntax errors and fix them. | |
4502
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
129 |
21989
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
130 (6) Local tryout: |
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
131 Vim normally picks up the .mo files from: |
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
132 $VIMRUNTIME/lang/{lang}/LC_MESSAGES/vim.mo |
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
133 To try out the messages with Vim use: |
22071
aa91480771fe
patch 8.2.1585: messages in globals.h not translated
Bram Moolenaar <Bram@vim.org>
parents:
21989
diff
changeset
|
134 make tryoutinstall |
21989
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
135 And run Vim with $VIMRUNTIME set to ../runtime |
52e970719f4b
patch 8.2.1544: cannot translate messages in a Vim script
Bram Moolenaar <Bram@vim.org>
parents:
16023
diff
changeset
|
136 |
4502
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
137 |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
138 USING GETTEXT WITHOUT ICONV |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
139 |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
140 When using gettext which doesn't support iconv, the encoding of the .mo file |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
141 must match your active encoding. For that you must convert and change |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
142 encoding of *.po file in advance of generating the *.mo file. For example, to |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
143 convert ja.po to EUC-JP (supposed as your system encoding): |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
144 |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
145 (1) Convert the file encoding: |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
146 |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
147 mv ja.po ja.po.orig |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
148 iconv -f utf-8 -t euc-jp ja.po.orig > ja.po |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
149 |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
150 (2) Rewrite charset declaration in the file: |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
151 |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
152 Open ja.po find this line: |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
153 "Content-Type: text/plain; charset=utf-8\n" |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
154 You should change "charset" like this: |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
155 "Content-Type: text/plain; charset=euc-jp\n" |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
156 |
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
1125
diff
changeset
|
157 There are examples in the Makefile for the conversions already supported. |