blob: 293edf2d4fc3d352520daaa5312ff1c25e0aea0a [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
Bram Moolenaar9964e462007-05-05 17:54:07 +00007 http://people.freenet.de/franco.bez/gettext/gettext_win32_en.html
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
9First read the README.txt file in this directory for general remarks on
10translating Vim messages.
11
12
13SETUP
14
Bram Moolenaar9964e462007-05-05 17:54:07 +000015Set the environment variable LANGUAGE to the language code for the language
16you are translating Vim messages to. Language codes are typically two
17characters and you can find a list of them at:
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
19 http://www.geocities.com/click2speak/languages.html
20
Bram Moolenaar9964e462007-05-05 17:54:07 +000021Another possibility is to use the gnuwin32 port of gettext. This is
22recommended especially if you use already gnuwin32 tools to gunzip, bunzip,
23patch etc. these files. You find the gnuwin32 version of gettext here:
24
25 http://gnuwin32.sourceforge.net/packages/gettext.htm
26
27Yet another very strait forward way is to get the sources of gettext from
28
29 http://www.gnu.org/software/gettext/gettext.html
30
31and build your own version of these tools. The documentation states that this
32should be possible with MSVC4.0, MSVC5.0, MSVC6.0 or MSVC7.0, but you can
33build it even successfully with MSVC8.0.
34
Bram Moolenaar071d4272004-06-13 20:20:40 +000035The LANGUAGE environment variable can be set from the command line, by adding
36a line to your autoexec.bat file, or by defining a user variable from the
37Advanced tab in the System control panel.
38
39Next, edit Make_mvc.mak so that GETTEXT_PATH points the binary directory of
Bram Moolenaar9964e462007-05-05 17:54:07 +000040the installation.
Bram Moolenaar071d4272004-06-13 20:20:40 +000041
42
43CREATING A NEW TRANSLATION
44
45When creating a new translation you must add your language code to the
46Make_mvc.mak file in the lines defining LANGUAGES and MOFILES. To create the
47initial .po file for your language you must use the command:
48
49 make -f make_mvc.mak first_time
50
51Note: You need to be in the po directory when using this makefile.
52
53Once you have your new .po file load it into Vim and source cleanup.vim, this
54will convert untranslated messages to comments. If you have syntax
55highlighting turned on then untranslated messages will stand out more easily.
56
57You will also need to edit the file names in the comments in the .po file.
58You need to remove the absolute directory specification (which has the form
59c:\vim61\src\). You can do this in Vim with the following command with the
Bram Moolenaar9964e462007-05-05 17:54:07 +000060appropriate directory specification for where you have installed the Vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000061source:
62
63 %s/c:\\vim61\\src\\//g
64
65
66UPDATING A TRANSLATION
67
68If there are new or changed messages in Vim that need translating, then the
69first thing to do is merge them into the existing translations. This is done
70with the following command:
71
72 nmake -f Make_mvc.mak xx.po
73
Bram Moolenaar9964e462007-05-05 17:54:07 +000074where xx is the language code for the language needing translations. The
Bram Moolenaar071d4272004-06-13 20:20:40 +000075original .po file is copied to xx.po.orig.
76
77
78DOING THE TRANSLATION
79
80Now that you have a .po file you can do the translations for all messages that
81need it. See README.txt for specific instructions.
82
83Once you have finished translating the messages you should make sure all
84non-translated strings are commented out. This can be done by sourcing
85cleanup.vim once again.
86
87
88CHECKING THE TRANSLATION
89
90Check the translation with the following command:
91
92 nmake -f make_mvc.mak xx.mo
93
94Correct any syntax errors reported. When there are no more errors, the
95translation is ready to be installed.
96
97
98INSTALLING THE TRANSLATION
99
100Install your translation with the following command:
101
102 nmake -f make_mvc.mak install
103
104This will create the xx\LC_MESSAGES directory in runtime\lang if it does not
105already exist.
106
107
108vim:tw=78: