blob: a7e3259dca680bf7e282250518014c1ea9567dee [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001TRANSLATING VIM MESSAGES
2
3This file explains how to create and maintain po files using
4gnu-gettext.win32, a MINGW32 Windows port of gettext by Franco Bez
5<franco.bez@gmx.de>. You can find it at:
6
7 http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
8
9First read the README.txt file for the general remarks
10
11
12The file that does the work is Make_ming.mak in the po directory. It is an
13adaptation of the Unix Makefile, but it does NOT test the presence of any po,
14pot, or mo files, so use it at your own risk but with care: it could even kill
15your canary. It has been tested by me several times (and with different
16languages) with success.
17
18The make utility must be run from the po directory.
19
Bram Moolenaar3b0dd7c2010-08-01 14:36:59 +020020First of all you must set the environment variable LANGUAGE to xx, where xx is
Bram Moolenaar071d4272004-06-13 20:20:40 +000021the name of your language. You can do it from the command line or adding a
22line to your autoexec.bat file: set LANGUAGE=xx. You must also add your
RestorerZ76ba7242024-01-22 20:28:12 +010023language to the Make_all.mak file in the lines LANGUAGES, MOFILES, POFILES,
24and CHECKFILES. If the encoding of the translation text differs from the
25default UTF-8, add a corresponding entry in MOCONVERTED, specifying the
26required encoding.
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
28If you don't have a xx.po file, you must create it with the command:
29
30 make -f Make_ming.mak first_time
31
32This will produce a new brand xx.po file with all the messages in Vim ready
33for translation. Then you must source the cleanup.vim script from inside Vim;
34it will comment the untranslated messages (now, all). I recommend to use
35syntax highlighting so you can identify the untranslated messages easily.
36You also must remove the '..\' that prepends the name of the source files.
37(I don't no why, but make is unable to change the directory from po to src and
38back to po, so all the work must be done from the po dir, hence the '..\')
39
40Then you must go step (2) below.
41
42If you are updating a po file you must follow the next steps (they are nearly
43the same as in the Unix case, only the commands change):
44
45(1) Add new and changed messages from the Vim sources:
46
47 make -f Make_ming.mak xx
48
49 This will extract all the strings from Vim and merge them in with the
50 existing translations. Requires the GNU gettext utilities. Also requires
51 unpacking the extra archive.
52 Your original xx.po file will be copied to xx.po.orig
53
54 -- After you do this, you MUST do the next three steps! --
55
56(2) Translate
57 See the gettext documentation on how to do this. You can also find
58 examples in the other po files.
59 Search the po file for items that require translation:
60 /\#\~ and also the fuzzy translations, /\#, fuzzy
61 Remove "#~" and "#, fuzzy" after adding the translation.
62
63 There is one special message:
Christian Brabandte978b452023-08-13 10:33:05 +020064 msgid "Messages maintainer: The Vim Project"
Christian Brabandtee17b6f2023-09-09 11:23:50 +020065 You should include your name and e-mail address instead, for example:
Bram Moolenaar071d4272004-06-13 20:20:40 +000066 msgstr "Berichten übersetzt bei: John Doe <john@doe.org>"
67
68(3) Clean up
69 This is very important to make sure the translation works on all systems.
70 Comment-out all non-translated strings. There are two types:
71 - items marked with "#, fuzzy"
72 - items with an empty msgstr
73 You can do this with the cleanup.vim script:
74
75 :source cleanup.vim
76
77(4) Check:
78
Bram Moolenaar58d98232005-07-23 22:25:46 +000079 vim -S check.vim xx.po
Bram Moolenaar071d4272004-06-13 20:20:40 +000080 make -f Make_ming.mak xx.mo
81
82 Look out for syntax errors and fix them.
83
84(5) This is an extra step, ;-). If you want the vim.mo file installed in your
85 system you must run:
86
87 make -f Make_ming.mak install
88
89 This will create the xx\LC_MESSAGES directory (if it does not exist) and
90 will copy vim.po to it.
Bram Moolenaar01380622015-12-29 16:04:42 +010091 You can also use the following command to install all languages:
92
93 make -f Make_ming.mak install-all
Bram Moolenaar071d4272004-06-13 20:20:40 +000094
95(6) Another extra step ;-)). The command:
96
97 make -f Make_ming.mak clean
98
99 will delete the temp files created during the process.
100
101Suggestions will be welcomed.
102
103Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
104
105Happy Vimming with NLS!!
106
107vim:tw=78: