blob: c63ad1fe81905c908dd20a5fc062bcd916559091 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001TRANSLATING VIM MESSAGES
2
Bram Moolenaar41317732010-08-02 21:43:29 +02003This file explains how to create and maintain po files using a number of
4GnuWin packages. You will need gettext, libiconv and libexpat. As of
5August 2010 the versions known to work are gettext 0.14.4, libiconv 1.9.2-1
6and expat 2.0.1. gettext and libiconv can be found at:
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
Bram Moolenaar41317732010-08-02 21:43:29 +02008 http://gnuwin32.sourceforge.net/
9
10expat can be found at:
11
12 http://sourceforge.net/projects/expat/
13
14expat will install into its own directory. You should copy libexpat.dll into
15the bin directory created from the gettext/libiconv packages.
Bram Moolenaar071d4272004-06-13 20:20:40 +000016
17First read the README.txt file in this directory for general remarks on
18translating Vim messages.
19
20
21SETUP
22
Bram Moolenaar9964e462007-05-05 17:54:07 +000023Set the environment variable LANGUAGE to the language code for the language
24you are translating Vim messages to. Language codes are typically two
25characters and you can find a list of them at:
Bram Moolenaar071d4272004-06-13 20:20:40 +000026
27 http://www.geocities.com/click2speak/languages.html
28
Bram Moolenaar9964e462007-05-05 17:54:07 +000029Another possibility is to use the gnuwin32 port of gettext. This is
30recommended especially if you use already gnuwin32 tools to gunzip, bunzip,
31patch etc. these files. You find the gnuwin32 version of gettext here:
32
33 http://gnuwin32.sourceforge.net/packages/gettext.htm
34
35Yet another very strait forward way is to get the sources of gettext from
36
37 http://www.gnu.org/software/gettext/gettext.html
38
39and build your own version of these tools. The documentation states that this
40should be possible with MSVC4.0, MSVC5.0, MSVC6.0 or MSVC7.0, but you can
41build it even successfully with MSVC8.0.
42
Bram Moolenaar071d4272004-06-13 20:20:40 +000043The LANGUAGE environment variable can be set from the command line, by adding
44a line to your autoexec.bat file, or by defining a user variable from the
45Advanced tab in the System control panel.
46
47Next, edit Make_mvc.mak so that GETTEXT_PATH points the binary directory of
Bram Moolenaar9964e462007-05-05 17:54:07 +000048the installation.
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
50
51CREATING A NEW TRANSLATION
52
53When creating a new translation you must add your language code to the
54Make_mvc.mak file in the lines defining LANGUAGES and MOFILES. To create the
55initial .po file for your language you must use the command:
56
57 make -f make_mvc.mak first_time
58
59Note: You need to be in the po directory when using this makefile.
60
61Once you have your new .po file load it into Vim and source cleanup.vim, this
62will convert untranslated messages to comments. If you have syntax
63highlighting turned on then untranslated messages will stand out more easily.
64
65You will also need to edit the file names in the comments in the .po file.
66You need to remove the absolute directory specification (which has the form
67c:\vim61\src\). You can do this in Vim with the following command with the
Bram Moolenaar9964e462007-05-05 17:54:07 +000068appropriate directory specification for where you have installed the Vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000069source:
70
71 %s/c:\\vim61\\src\\//g
72
73
74UPDATING A TRANSLATION
75
76If there are new or changed messages in Vim that need translating, then the
77first thing to do is merge them into the existing translations. This is done
78with the following command:
79
80 nmake -f Make_mvc.mak xx.po
81
Bram Moolenaar9964e462007-05-05 17:54:07 +000082where xx is the language code for the language needing translations. The
Bram Moolenaar071d4272004-06-13 20:20:40 +000083original .po file is copied to xx.po.orig.
84
85
86DOING THE TRANSLATION
87
88Now that you have a .po file you can do the translations for all messages that
89need it. See README.txt for specific instructions.
90
91Once you have finished translating the messages you should make sure all
92non-translated strings are commented out. This can be done by sourcing
93cleanup.vim once again.
94
95
96CHECKING THE TRANSLATION
97
98Check the translation with the following command:
99
100 nmake -f make_mvc.mak xx.mo
101
102Correct any syntax errors reported. When there are no more errors, the
103translation is ready to be installed.
104
105
106INSTALLING THE TRANSLATION
107
108Install your translation with the following command:
109
110 nmake -f make_mvc.mak install
111
112This will create the xx\LC_MESSAGES directory in runtime\lang if it does not
113already exist.
Bram Moolenaar01380622015-12-29 16:04:42 +0100114You can also use the following command to install all languages:
115
116 nmake -f make_mvc.mak install-all
Bram Moolenaar071d4272004-06-13 20:20:40 +0000117
118
119vim:tw=78: