3 If you are contributing code or translations to the Subversion project,
4 please read this first.
6 ===============================
7 Guide to translating Subversion
8 ===============================
13 * Software version requirements
14 * Starting a new translation
15 * Verifying your po file
16 * Submitting your po file
17 * Updating existing po files
18 * Maintenance on branches
19 * Requirements for po and mo files
20 * Conventions for the empty string msgid section
22 * Single versus double quotes
23 * Error message conventions
30 Subversion uses gettext for its translation. Gettext uses '.po' files
31 to store translation information; the existing ones are kept in the
32 subversion/po directory of the repository.
33 [Note that the last paragraph deliberately does not say GNU gettext.]
35 Please take some time to go through this document as well as
40 Software version requirements
41 =============================
43 The Makefile build targets locale-gnu-* (used to maintain po files)
44 require GNU gettext 0.13 or newer. Note that this is not a requirement
45 for those wanting to compile the *.po files into *.mo's.
49 Starting a new translation
50 ==========================
52 Before starting a new translation please contact the subversion
53 development mailing list to make sure you are not duplicating efforts. Also
54 please note that the project has a strong preference for translations which
55 are maintained by more than one person: mailing the lists with your
56 intentions might help you find supporters.
58 After that, you should perform the following steps:
62 1) check out Subversion (see INSTALL for more information)
65 4) run make locale-gnu-pot
66 This step is currently only supported for GNU gettext Makefile based
68 5) run msginit --locale LOCALE -o LOCALE.po in the
69 subversion/po directory of your working copy. LOCALE is the ll[_LL]
70 language and country code used to identify your locale.
72 Steps (2) and (3) generate a Makefile; step (4) generates
73 subversion/po/subversion.pot
75 The Subversion project has a policy not to put names in its files, so
76 please apply the two changes described below. (See www/hacking.html
77 for a description of this convention.)
80 The header in the newly generated .po file looks like this:
81 # SOME DESCRIPTIVE TITLE.
82 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
83 # This file is distributed under the same license as the PACKAGE package.
84 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
86 Please replace that block with the following text:
87 # <Your language> translation for subversion package
88 # Copyright (C) <YEAR> CollabNet.
89 # This file is distributed under the same license as the subversion package.
91 The first translation block in the .po file contains two lines like these:
92 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
93 "Language-Team: LANGUAGE <LL@li.org>\n"
95 Please replace those with these two lines:
96 "Last-Translator: Subversion Developers <dev@subversion.tigris.org>\n"
97 "Language-Team: YOUR LANGUAGE <dev@subversion.tigris.org>\n"
100 * Unix (non-GNU gettext)
106 See issue #1977 in the subversion issue tracker
108 For the time being, hourly updated subversion.pot files are posted at:
110 http://hix.nu/subversion/trunk/subversion.pot (for trunk)
111 http://hix.nu/subversion/1.1.x/subversion.pot (for 1.1.x)
115 Verifying your po file
116 ======================
118 Before submitting to the mailing list or committing to the repository,
119 please make sure your po file 'compiles'. You can do this with these
120 steps (on Makefile based systems):
122 1) run './autogen.sh'
123 2) run './configure' (with the appropriate arguments)
126 The autogen.sh step is important, since it adds new po files as
127 dependencies of the 'locale' build target. Note however that steps 1
128 and 2 are only needed once after you have added a new translation.
132 Submitting your po file
133 =======================
135 Please don't mail large po files to the mailing lists. There are many
136 subscribers on dev@subversion.tigris.org who are on slow links and do
137 not want to receive a large file by email. Instead, place the po file
138 somewhere on the Internet for download, and just post the URL. If you
139 do not have a site available, please ask on dev@ and someone will help
142 Of course, if you have commit access to the Subversion repository, you
143 can just commit the po file there, assuming all other requirements
148 Updating existing po files
149 ==========================
151 The Makefile based part of the build system contains a make target to
152 facilitate maintenance of existing po files. To update po files on
153 systems with GNU gettext run
155 make locale-gnu-po-update
157 To only update a particular language, you may use
159 make locale-gnu-po-update PO=ll
161 where ll is the name of the po file without the extension (i.e. PO=sv).
163 It is recommended that the .po update is done by using two commits; one
164 after the "make locale-gnu-po-update", and one after the translation is
165 done. This has two advantages:
167 - gettext(1) produces lots of line number changes which makes the
168 resulting diff hard to review by the other translators. By committing
169 twice, all the line number changes are stored in the first commit, and
170 the second commit contains all the actual translations with no extra
172 - If there are several translators for a specific language (which is
173 highly preferred by the project) you don't risk working for hours just
174 to find that some other translator already has done the job when
175 you're finished. You will immediately notice that someone else is
176 working on the .po file when you try to perform the first commit,
177 because svn will tell you that the file is outdated.
180 Maintenance on branches
181 =======================
183 Editing po files in trunk is pretty straightforward, but gets a bit more
184 complicated when those changes are going to be transferred to a release
185 branch. Project policy is to make no direct changes on release branches,
186 everything that is committed to the branch should be merged from trunk.
187 This also applies to po files. Using 'svn merge' to do the job can lead
188 to conflicts and fuzzy messages due to the changes in line numbers and
189 string formatting done by gettext.
191 The scheme below eliminates any complexity which exists when using 'svn
192 merge' to do branch updates. The following rules apply:
194 - Translation updates go to trunk
195 - Messages required on the branch which ever existed on trunk
196 get merged from trunk
197 - There are 2 mass operations allowed on po files on branches:
198 * 'make locale-gnu-po-update'
199 * merging messages from trunk (see below)
200 - The remaining few messages which never existed on trunk
201 in any revision are translated on the branch
202 - Message options (such as fuzzy) can be tweaked
204 The above list is a complete enumeration of all operations allowed on
205 po files on branches.
207 Merging messages from trunk revision X of YY.po to your branch working
208 copy can be done with this command:
210 svn cat -r X http://svn.collab.net/repos/svn/trunk/subversion/po/YY.po | \
215 Requirements for po and mo files
216 ================================
218 On some gettext implementations we have to ensure that the mo files -
219 whether obtained through the project or created locally - are encoded
220 using UTF-8. This requirement stem from the fact that Subversion uses
221 UTF-8 internally, some implementations translate to the active locale
222 and the fact that bind_textdomain_codeset() is not portable across
225 To satisfy this requirement po files are required to be UTF-8 encoded.
226 If the gettext implementation on the target system doesn't support
227 bind_textdomain_codeset(), the build system will ensure that the mo
228 file is in UTF-8 by removing the Content-Type header from the po file
229 header. Note that some msgfmt utilities dislike the absence of the
230 charset designator and will generate warnings along the lines of
231 "Won't be able to do character set conversion" because of it. You can
232 safely ignore these warnings.
236 Conventions for the empty string msgid section
237 ==============================================
239 Some gettext implementations use a section with a msgid "" (empty
240 string) to keep administrative data. One of the headers suggested is
241 the 'Last-Translator:' field. Because the Subversion project has a
242 policy not to name contributors in specific files, but give credit in
243 the repository log messages, you are required not to put your name in
246 Since some tools require this field to consider the po file valid
247 (i.e. Emacs PO Mode), you can put "dev@subversion.tigris.org" into
255 The GNU translation project
256 (http://www2.iro.umontreal.ca/~gnutra/po/HTML/) attempts to organise
257 translation attempts and get translators for various packages. Some
258 teams have guidelines to stimulate consistency across packages.
262 Single versus double quotes
263 ===========================
265 The project has standardised the use of quotes. Some translation
266 teams have done the same. If there is no translation team for your
267 locale or they did not standardise quoting, please follow the project
268 guidelines per www/hacking.html. If they did: follow them :-)
272 Error message conventions
273 =========================
275 Since translators will generally see all error messages in the code,
276 it's important to know that there is a special section in
277 www/hacking.html about this category of strings. Here the same
278 applies as does for the quotes: Adhere to them on all points for which
279 there is no explicit policy set out by the translation team for your
282 vim: set tw=72 ts=2 sw=2 sts=2 et fo-=2w fo+=n js :