~intltool/intltool/trunk

178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
1
intltool README
352 by kenneth
2003-01-18 Kenneth Christiansen <kenneth@gnu.org>
2
===============
3
4
If you have problems understanding this README file, then please report 
700 by Rodney Dawes
Remove references to dead mailing lists
5
these at http://bugs.launchpad.net/intltool on Launchpad. Patches are
6
also very welcome. See HACKING for more information on submitting patches.
436 by kenneth
2004-01-22 Kenneth Rohde Christiansen <kenneth@gnu.org>
7
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
8
The intltool collection can be used to do these things:
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
9
10
 o Extract translatable strings from various source files (.xml.in,
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
11
   .glade, .desktop.in, .server.in, .oaf.in).
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
12
13
 o Collect the extracted strings together with messages from traditional
14
   source files (.c, .h) in po/$(PACKAGE).pot.
15
16
 o Merge back the translations from .po files into .xml, .desktop and
17
   .oaf files.  This merge step will happen at build resp. installation
18
   time.
11 by kenneth
use info
19
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
20
The intltool package has a script, intltoolize, which copies the various
21
scripts and does the other magic to your module. So users building
176 by darin
First cut at all the name changes to call it intltool.
22
from tarballs don't need intltool, only folks building from cvs.
399 by malcolm
* intltoolize.in: Install OrigTree.pm in the distribution tree.
23
(This is modelled on gettextize.)
11 by kenneth
use info
24
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
25
352 by kenneth
2003-01-18 Kenneth Christiansen <kenneth@gnu.org>
26
How to Use with autoconf/automake
27
---------------------------------
28
(There is a section for non-auto* configurations below)
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
29
166 by carlos
2001-09-19 Carlos Perelló Marín <carlos@gnome-db.org>
30
To use intltool in your module, do the following:
11 by kenneth
use info
31
166 by carlos
2001-09-19 Carlos Perelló Marín <carlos@gnome-db.org>
32
 o Install intltool, and make sure that the macro it installs is
115 by darin
2001-05-09 Darin Adler <darin@eazel.com>
33
   in aclocal's path, or do:
11 by kenneth
use info
34
24 by darin
* README: Fix formatting. Mention .cvsignore.
35
	export ACLOCAL_FLAGS='-I /usr/local/share/aclocal' 
11 by kenneth
use info
36
115 by darin
2001-05-09 Darin Adler <darin@eazel.com>
37
 o Add these lines to autogen.sh, after the call to gettextize:
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
38
176 by darin
First cut at all the name changes to call it intltool.
39
	echo "Running intltoolize"
40
	intltoolize --copy --force --automake
11 by kenneth
use info
41
115 by darin
2001-05-09 Darin Adler <darin@eazel.com>
42
 o Add this line to configure.in near the top
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
43
659 by dobey
2008-06-06 Rodney Dawes <dobey.pwns@gmail.com>
44
	IT_PROG_INTLTOOL([minimum required version], [no-xml])
15 by mstachow
* README: Some fixes suggested by Darin.
45
530 by tpm
* README: Mention DISTCLEANFILES in automake section (without
46
 o Add intltool-extract, intltool-merge, and intltool-update to
47
   DISTCLEANFILES in your top-level Makefile.am.
48
176 by darin
First cut at all the name changes to call it intltool.
49
 o Remove po/desk.pl and po/update.* scripts.  intltool-update will take
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
50
   over their functionality.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
51
52
At this point, translatable strings will be automatically extracted to
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
53
the .po files, if you make use of the following recommendations.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
54
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
55
The intltool-prepare script will help you to prepare the package. It will
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
56
try to extract translations from existing .desktop files which will
176 by darin
First cut at all the name changes to call it intltool.
57
become obsolete after intltoolization has taken place.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
58
709 by Danilo Šegan
Fix some typos and errors.
59
Examples of packages that use intltool are many of the GNOME components:
60
find them at http://git.gnome.org/.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
61
659 by dobey
2008-06-06 Rodney Dawes <dobey.pwns@gmail.com>
62
Details of the IT_PROG_INTLTOOL macro
153 by cyrille
* xml-i18n-tools.m4: Added a second, optional parameter. If this
63
-------------------------------------------
64
453 by dobey
2004-06-12 Rodney Dawes <dobey@novell.com>
65
The first parameter indicates the minimum required version. The
66
configure script will halt if the version is older than the first
67
parameter.
68
69
The second parameter is to tell intltool that we don't need the
70
extended xml parsing abilities provided by the XML::Parser perl
71
module. If it is not provided, or is any value other than "no-xml",
72
then XML::Parser will be checked for by the configure script. This
73
feature is only available in intltool 0.31 or newer.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
74
75
Extra Steps for DESKTOP Files
76
..............................
77
78
This step also applies for similar files (.directory, .soundlist).
79
176 by darin
First cut at all the name changes to call it intltool.
80
 o Try to run intltool-prepare.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
81
176 by darin
First cut at all the name changes to call it intltool.
82
 o Make sure intltool-prepare did find existing translations in the old
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
83
   .desktop files and did correctly merge them into the various po/*.po
84
   files.  Don't forget to commit the changed .po files; otherwise
85
   exiting translations will get lost!
86
87
 o Remove old .desktop files and add new .desktop.in files.
88
702.2.1 by Pablo Castellano
Updated README
89
 o Adjust .cvsignore, .gitignore, .bzrignore or similar.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
90
91
 o Adjust Makefile.am, e.g.:
92
93
	--- start ----
94
95
        utilsdir = $(datadir)/gnome/apps/Utilities
96
        utils_in_files = bug-buddy.desktop.in
97
        utils_DATA = $(utils_in_files:.desktop.in=.desktop)
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
98
        @INTLTOOL_DESKTOP_RULE@
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
99
100
	--- end ----
101
102
 o Add .desktop.in files to po/POTFILES.in
103
104
Here's a .desktop.in example:
105
106
	--- start ----
107
108
        [Desktop Entry]
109
        _Name=Bug Report Tool
110
        _Comment=Report a bug in GNOME
111
        Exec=bug-buddy
702.2.1 by Pablo Castellano
Updated README
112
        Icon=bug-buddy
113
        Terminal=false
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
114
        Type=Application
115
116
	--- end ----
117
118
119
Extra Steps for GLADE Files
120
...........................
121
122
 o Add the .glade files you want translated to POTFILES.in
123
124
 o Remove the intermediate *-glade.h or strings-glade.c files and drop
125
   them from POTFILES.in
126
127
688 by dobey
128
Extra Steps for SERVER Files (formerly .server)
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
129
.............................
118 by laszlo
message extraction and merge back from files with .xml extension added
130
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
131
To get server translation extraction and merging requires a few more steps:
132
688 by dobey
133
 o Rename your .server files to .server.in and put an
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
134
   underscore before every value property for string attributes that should
135
   be localized.
136
688 by dobey
137
 o Add the new .server.in or .server.in files to POTFILES.in.
70 by darin
* README: Mention the need to have at least one .po file in the
138
115 by darin
2001-05-09 Darin Adler <darin@eazel.com>
139
 o Put lines like these in every Makefile.am that installs oaf files:
11 by kenneth
use info
140
 
24 by darin
* README: Fix formatting. Mention .cvsignore.
141
	--- start ----
142
 
688 by dobey
143
	serverdir = $(libdir)/bonobo/servers
144
 
145
	server_in_files = My_Server_file.server.in
146
	server_DATA = $(server_in_files:.server.in=.server)
147
 
148
	@INTLTOOL_SERVER_RULE@
149
 
150
	EXTRA_DIST=$(server_in_files) $(server_DATA)
24 by darin
* README: Fix formatting. Mention .cvsignore.
151
 
152
	--- end ----
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
153
688 by dobey
154
At this point, your server translations will be extracted and merged.
132 by ke
2001-06-03 Karl Eichwalder <ke@suse.de>
155
156
Extra Steps for XML Files (Files with .xml Extension)
157
.....................................................
118 by laszlo
message extraction and merge back from files with .xml extension added
158
159
To get xml (files with .xml extension) translation extraction 
160
and merging requires these steps:
161
162
 o Rename your .xml files to .xml.in and put an underscore before 
163
   every element that should be localized.
164
165
 o Add the .xml.in files to POTFILES.in.
166
167
 o Put lines like these in every Makefile.am that installs xml files:
168
169
        --- start ----
170
171
        xmldir = $(datadir)/xml
172
173
        xml_in_files = My_xml_file.xml.in
174
        xml_DATA = $(xml_in_files:.xml.in=.xml)
175
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
176
        @INTLTOOL_XML_RULE@
118 by laszlo
message extraction and merge back from files with .xml extension added
177
178
        EXTRA_DIST=$(xml_in_files) $(xml_DATA)
179
180
        --- end ----
181
182
At this point, your xml translations will be extracted and
148 by cyrille
* xml-i18n-merge.in.in: added two new flags, --pass-through(-p)
183
merged. All .po files will be converted on the fly to UTF-8, and the
184
resulting XML file will have a UTF-8 effective encoding (you should
185
make sure that the encoding="..." declaration in the .xml.in file is
186
either absent or actually specifies UTF-8).
187
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
188
Previous versions of intltool generated XML files whose contents
148 by cyrille
* xml-i18n-merge.in.in: added two new flags, --pass-through(-p)
189
were made of the contents of the .po files, without paying attention
190
to the encodings used. A single "XML" file could thus have strings in
178 by darin
* NEWS: Put some things in to prepare for a 0.10 release.
191
different encodings. This broken behavior can be requested only by
192
using the old xml-i18n-tools API instead of the intltool one. See old
193
versions of xml-i18n-tools for documentation on how the old API worked.
149 by cyrille
* xml-i18n-merge.in.in: (get_po_encoding): put a warning and a
194
195
---
196
197
XXX: add section for KEYS files. Works almost like XML files .
352 by kenneth
2003-01-18 Kenneth Christiansen <kenneth@gnu.org>
198
199
How to use without autoconf/automake
200
------------------------------------
201
202
intltool can also be used without the auto* tools. For instance in order 
203
to translate a somename.desktop.in file, you can do the following.
204
205
 o Create a po/ dir.
206
 o Add a po/POTFILES.in file, including the path to the 
207
   somename.desktop.in  file
208
209
Then to create the somename.desktop file all you do is:
210
211
$ intltool-merge po/ -d -u -c po/.intltool-merge-cache somename.desktop.in
212
somename.desktop
213
214
You can also type intltool-merge --help for a bit more info.
432 by markmc
2004-01-19 Mark McLoughlin <mark@skynet.ie>
215
460 by danilo
2004-06-14 Danilo Å egan <dsegan@gmx.net>
216
To specify parameters for intltool-update (such as keywords or gettext
217
domain), you can use Makevars syntax as used in recent GNU gettext, by
218
putting something like the following in po/Makevars file:
219
220
  DOMAIN = mydomain
221
  XGETTEXT_OPTIONS = --keyword --keyword=blah
222
223
This will make "intltool-update -p" produce mydomain.pot, passing
224
parameters "--keyword --keyword=blah" to xgettext when extracting
225
strings.
432 by markmc
2004-01-19 Mark McLoughlin <mark@skynet.ie>
226
227
Passing special parameters to xgettext via environment
228
......................................................
229
230
If you need to add parameters passed to xgettext on a case-by-case
231
basis, you can do so using environment variable XGETTEXT_ARGS.
232
233
If you would run it as follows:
234
235
	XGETTEXT_ARGS=--no-location intltool-update -p
236
237
You would create a PO Template file without lines which indicate
238
location of messages in the source code.
239
240
241
Changing keywords used in xgettext invocation
242
.............................................
243
244
If you need to change default keywords used to extract messages from 
245
source code, you need to add variable XGETTEXT_KEYWORDS to 
246
Makefile.in.in file inside directory where intltool-update is run
247
from, eg.
248
249
        --- start ----
250
251
        XGETTEXT_KEYWORDS = --keyword --keyword=P_
252
253
        --- end ----
254
255
Default keywords xgettext looks for if no XGETTEXT_KEYWORDS is defined
256
are _, N_ and U_. 
445 by danilo
Add support for translators comments in XML files.
257
258
259
Translators' comments in XML and .schemas files
260
...............................................
261
262
To provide comments to translators in free-form XML or .schema files, 
263
you need to precede the string to be translated with the plain XML 
525 by danilo
Updated README for comment handling.
264
comment.
445 by danilo
Add support for translators comments in XML files.
265
266
In .schemas files, comments need to be inside <default>, <short> or 
267
<long> elements (i.e. they cannot be before the opening tag).