blob: cd107debf4573f354dcef474e2674e833fa17511 [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 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 in this directory for general remarks on
10translating Vim messages.
11
12
13SETUP
14
15Set the enviroment variable LANGUAGE to the language code for the language you
16are translating Vim messages to. Languagde codes are typically two characters
17and you can find a list of them at:
18
19 http://www.geocities.com/click2speak/languages.html
20
21The LANGUAGE environment variable can be set from the command line, by adding
22a line to your autoexec.bat file, or by defining a user variable from the
23Advanced tab in the System control panel.
24
25Next, edit Make_mvc.mak so that GETTEXT_PATH points the binary directory of
26the intallation.
27
28
29CREATING A NEW TRANSLATION
30
31When creating a new translation you must add your language code to the
32Make_mvc.mak file in the lines defining LANGUAGES and MOFILES. To create the
33initial .po file for your language you must use the command:
34
35 make -f make_mvc.mak first_time
36
37Note: You need to be in the po directory when using this makefile.
38
39Once you have your new .po file load it into Vim and source cleanup.vim, this
40will convert untranslated messages to comments. If you have syntax
41highlighting turned on then untranslated messages will stand out more easily.
42
43You will also need to edit the file names in the comments in the .po file.
44You need to remove the absolute directory specification (which has the form
45c:\vim61\src\). You can do this in Vim with the following command with the
46appropriate directory specfication for where you have installed the Vim
47source:
48
49 %s/c:\\vim61\\src\\//g
50
51
52UPDATING A TRANSLATION
53
54If there are new or changed messages in Vim that need translating, then the
55first thing to do is merge them into the existing translations. This is done
56with the following command:
57
58 nmake -f Make_mvc.mak xx.po
59
60where xx is the langauge code for the language needing translations. The
61original .po file is copied to xx.po.orig.
62
63
64DOING THE TRANSLATION
65
66Now that you have a .po file you can do the translations for all messages that
67need it. See README.txt for specific instructions.
68
69Once you have finished translating the messages you should make sure all
70non-translated strings are commented out. This can be done by sourcing
71cleanup.vim once again.
72
73
74CHECKING THE TRANSLATION
75
76Check the translation with the following command:
77
78 nmake -f make_mvc.mak xx.mo
79
80Correct any syntax errors reported. When there are no more errors, the
81translation is ready to be installed.
82
83
84INSTALLING THE TRANSLATION
85
86Install your translation with the following command:
87
88 nmake -f make_mvc.mak install
89
90This will create the xx\LC_MESSAGES directory in runtime\lang if it does not
91already exist.
92
93
94vim:tw=78: