| 1 |
==============================================================================
|
| 2 |
# README.sources for debian-reference (Version 2 series) #
|
| 3 |
# Sat Sep 12 15:29:21 UTC 2009 #
|
| 4 |
# Osamu Aoki, osamu at debian dot org #
|
| 5 |
==============================================================================
|
| 6 |
|
| 7 |
I will touch on following topics.
|
| 8 |
|
| 9 |
* Quick guide
|
| 10 |
* Document style
|
| 11 |
* Basics of build process
|
| 12 |
* What is @@@ in asciidoc
|
| 13 |
* What is @-@ in asciidoc and raw XML
|
| 14 |
* Making copy of SVN contents
|
| 15 |
* Updating contents in English XML source
|
| 16 |
* Fixing typo in English XML source
|
| 17 |
* Updating remote data contents
|
| 18 |
* Creating Translation PO for a new language
|
| 19 |
* Updating Translation PO
|
| 20 |
* Updating for new release (squeeze --> squeeze+1)
|
| 21 |
* URL used for translation and its initialization
|
| 22 |
* Utilities for spell check
|
| 23 |
* Utilities of PO (split and merge and uniq PO)
|
| 24 |
* VCS locations and history
|
| 25 |
|
| 26 |
== Quick guide ==
|
| 27 |
|
| 28 |
Please note that for http://www.debian.org/ web site publishing, XML/PO
|
| 29 |
files are used to build pages. Before committing, please do this.
|
| 30 |
|
| 31 |
* Update from SVN to get the latest source: "svn co" or "svn up"
|
| 32 |
* Fix fuzzy in PO using via poedit GUI etc.
|
| 33 |
* Update XML/PO files.
|
| 34 |
* If updated English ascoodoc: "make xml"
|
| 35 |
* If updated translation PO only: "make po"
|
| 36 |
* Fix fuzzy in PO using via poedit GUI etc.
|
| 37 |
* Generate HTML to check result.
|
| 38 |
* If updated English ascoodoc: "make all"
|
| 39 |
* If updated translation PO only: "make po-test"
|
| 40 |
|
| 41 |
Please note old translated documents are in SGML and its content is very
|
| 42 |
loosely related to current English content. In order to recycle as much
|
| 43 |
old content, I usually use followings:
|
| 44 |
|
| 45 |
* "poedit" to edit debian-reference.??.po file to be updated.
|
| 46 |
* browser to display debian-reference.??.html from sage/lenny package
|
| 47 |
* copy-and-paste to po file (via poedit GUI)
|
| 48 |
* add XML tags as needed
|
| 49 |
|
| 50 |
There are few utilities scripts I use to maintain this package. Please
|
| 51 |
copy them to from utils/ directory to directory included in $PATH such as
|
| 52 |
/usr/local/bin/.
|
| 53 |
|
| 54 |
== Document style ==
|
| 55 |
|
| 56 |
Besides things mentioned in "About this document" in Preface,
|
| 57 |
I used IBM Style Guide (IBM_Style_27Apr09.pdf) from IBM site:
|
| 58 |
URL: http://www.ibm.com/software/ucd/files/IBM_Style_27Apr09.pdf
|
| 59 |
( You may wish to check newer version linked from:
|
| 60 |
URL: http://www.ibm.com/software/ucd/otherresources.html )
|
| 61 |
|
| 62 |
Currently, there is big gap. I will slowly polish this document to be
|
| 63 |
compliant as possible.
|
| 64 |
|
| 65 |
There are exceptions.
|
| 66 |
* I use Latin acronyms: e.g., etc., i.e., read/write
|
| 67 |
* I use lines starting with number
|
| 68 |
|
| 69 |
== Basics of build process ==
|
| 70 |
|
| 71 |
You must have lenny system with following packages installed:
|
| 72 |
* subversion
|
| 73 |
* pbuilder
|
| 74 |
* asciidoc (only if you update English)
|
| 75 |
* libxml2-utils
|
| 76 |
* devscripts
|
| 77 |
* wget
|
| 78 |
* dctrl-tools
|
| 79 |
* Files in debian/control Build-Depends
|
| 80 |
|
| 81 |
Basic flow of build process can be summarized as:
|
| 82 |
|
| 83 |
all the asciidoc/*.txt files and remotely fetched files by wget
|
| 84 |
:(asciidoc @ lenny version) :
|
| 85 |
:(build from asciidoc by :
|
| 86 |
: "make xml" or "make all") :
|
| 87 |
v v
|
| 88 |
>>> debian-reference.raw.xml --> url.ent and other *.ent
|
| 89 |
(source XML) :(build from raw.xml by "make po" or "make po-test")
|
| 90 |
v
|
| 91 |
debian-reference.en.xml --> all English final formats (HTML, text)
|
| 92 |
debian-reference.en.xmlt \ (This removes untranslating part)
|
| 93 |
(XML file) | \ \
|
| 94 |
v \ \
|
| 95 |
debian-reference.pot +--+-> debian-reference.ja.xml
|
| 96 |
(POT file) | / |
|
| 97 |
v / v
|
| 98 |
>>> debian-reference.ja.po all Japanese final formats (HTML, text)
|
| 99 |
(PO file)
|
| 100 |
|
| 101 |
Please note po files are generated from English
|
| 102 |
debian-reference.en.xmlt. This debian-reference.en.xmlt is an XML file
|
| 103 |
very similar to debian-reference.en.xml which is also XML file.
|
| 104 |
Untranslatable contents in debian-reference.en.xml is replaced by
|
| 105 |
"DUMMY" to reduce clutter in PO file.
|
| 106 |
|
| 107 |
Please note actual build process starts from debian-reference.raw.xml and
|
| 108 |
debian-reference.ja.po files. These are "REAL" source files as far as
|
| 109 |
package build process and www.debian.org web page building process by
|
| 110 |
DDP are concerned.
|
| 111 |
|
| 112 |
Asciidoc format is used as a helper to make debian-reference.raw.xml
|
| 113 |
source with minimum typing. This will be dropped once squeeze is out.
|
| 114 |
After squeeze release, debian-reference.raw.xml will be the source.
|
| 115 |
|
| 116 |
Due to asciidoc conversion logic differences, we must use lenny version
|
| 117 |
of asciidoc for this source. Otherwise you get different output to the
|
| 118 |
raw.xml and break all the po files.
|
| 119 |
|
| 120 |
Please note Makefile has few key parameters which affects build process.
|
| 121 |
|
| 122 |
BUILD_MODE := xml (normal-build-from-raw-xml mode, default)
|
| 123 |
BUILD_MODE := asciidoc (build-from-asciidoc mode, use this via "all" "xml" target in lenny)
|
| 124 |
|
| 125 |
PDIR := something for normal build situation
|
| 126 |
PDIR := ddp-svn for /org/www.debian.org/ddp-svn/trunk/quick-reference
|
| 127 |
|
| 128 |
PUBLISHDIR := build result file location
|
| 129 |
|
| 130 |
LANGALL := language list for all
|
| 131 |
LANGPO := language list for PO based translation
|
| 132 |
LANGSGML := language list for SGML based old translation (calculated)
|
| 133 |
|
| 134 |
Please note following targets:
|
| 135 |
|
| 136 |
make all
|
| 137 |
Update source from asciidoc
|
| 138 |
Results are in $(PUBLISHDIR)
|
| 139 |
Do not require remote connection if you already have done so.
|
| 140 |
|
| 141 |
make xml
|
| 142 |
Create XML/PO source files from asciidoc
|
| 143 |
|
| 144 |
make po-test
|
| 145 |
Results are in $(PUBLISHDIR)
|
| 146 |
Build html etc using current raw.xml and po files
|
| 147 |
|
| 148 |
make po
|
| 149 |
Update PO files from raw.xml
|
| 150 |
|
| 151 |
make publish
|
| 152 |
Used by DDP for www.debian.org
|
| 153 |
Do not require remote connection nor asciidoc
|
| 154 |
|
| 155 |
make html
|
| 156 |
Create html files
|
| 157 |
|
| 158 |
make txt
|
| 159 |
Create txt files
|
| 160 |
|
| 161 |
make css
|
| 162 |
Create css files
|
| 163 |
|
| 164 |
make clean
|
| 165 |
Clean source to make it ready for packaging
|
| 166 |
|
| 167 |
make distclean
|
| 168 |
Clean source to make it ready to be updated remotely
|
| 169 |
|
| 170 |
make update
|
| 171 |
Update source with remote data.
|
| 172 |
|
| 173 |
== What is @@@ in asciidoc ==
|
| 174 |
|
| 175 |
You see quite a bit of @@@ in asciidoc source. That is placed there
|
| 176 |
when idiosyncrasy of asciidoc hit me. Asciidoc to raw.xml conversion
|
| 177 |
result is filtered with sed script bin/replace to get right characters
|
| 178 |
into a resulting XML file (debian-reference.en.raw) without worrying
|
| 179 |
about asciidoc converting to something funny.
|
| 180 |
|
| 181 |
For example: @@@sq@@@ is converted to '
|
| 182 |
|
| 183 |
These conversion occur right after asciidoc conversion but before
|
| 184 |
storing to raw.xml files. So this is purely work around for asciidoc
|
| 185 |
idiosyncrasies.
|
| 186 |
|
| 187 |
== What is @-@ in asciidoc and raw XML ==
|
| 188 |
|
| 189 |
You see quite a bit of @-@ in asciidoc and generated XML source. That
|
| 190 |
is placed there when auto-generated data replaces them as entity in the
|
| 191 |
final form (*.xml, *.po, *.html, ...).
|
| 192 |
|
| 193 |
For example: @-@foo@-@ is converted to &foo;
|
| 194 |
@-@popcon1@-@ is converted to popcon value and URL link of
|
| 195 |
package in column 1.
|
| 196 |
@-@psize1@-@ is converted to size value and URL link of
|
| 197 |
package in column 1.
|
| 198 |
@-@popcon2@-@ is converted to popcon value and URL link of
|
| 199 |
package in column 2.
|
| 200 |
@-@psize2@-@ is converted to size value and URL link of
|
| 201 |
package in column 2.
|
| 202 |
|
| 203 |
These survive asciidoc conversion but are transformed from raw.xml to
|
| 204 |
en.xml.
|
| 205 |
|
| 206 |
== Making copy of SVN contents ==
|
| 207 |
|
| 208 |
If you just need readonly access to SVN contents, you can do this with:
|
| 209 |
$ mkdir -p path/to/use/
|
| 210 |
$ cd path/to/use/
|
| 211 |
$ svn co svn://svn.debian.org/svn/ddp/manuals/trunk/quick-reference qref
|
| 212 |
|
| 213 |
If you need read/write access, please follow me ...
|
| 214 |
|
| 215 |
DR is part of Debian Documentation Project (DDP) at
|
| 216 |
http://www.debian.org/doc/ddp .
|
| 217 |
|
| 218 |
DDP uses alioth service.
|
| 219 |
|
| 220 |
If you do not have alioth account (i.e. non DD), you can set up by
|
| 221 |
clicking "New account" at the top right corner.
|
| 222 |
|
| 223 |
You can join DDP by clicking [Request to join] at
|
| 224 |
http://alioth.debian.org/projects/ddp/ and send your request to join.
|
| 225 |
You should send short reminder to debian-doc@lists.debian.org . Then
|
| 226 |
you can get alioth account activated for DDP. Please use English page
|
| 227 |
etc. (Otherwise we get non-English message)
|
| 228 |
|
| 229 |
You should set up SSH (passwordless login). Then:
|
| 230 |
|
| 231 |
$ mkdir -p path/to/use/
|
| 232 |
$ cd path/to/use/
|
| 233 |
$ svn co svn+ssh://svn.debian.org/svn/ddp/manuals/trunk/qick-reference qref
|
| 234 |
|
| 235 |
== Updating contents in English XML source ==
|
| 236 |
|
| 237 |
Typical work flow of creating latest XML source from asciidoc/po4a is:
|
| 238 |
|
| 239 |
* Get latest source with "svn up" to sync with latest upstream.
|
| 240 |
* Edit "asciidoc/*.txt" files to update English contents if needed.
|
| 241 |
* Run "make xml".
|
| 242 |
--> It runs msgmerge for you.
|
| 243 |
* Edit "po4a/debian-reference.??.po" to update translation if needed.
|
| 244 |
--> remove "fuzzy" while fixing translation.
|
| 245 |
* Run "make all" for test build html,
|
| 246 |
--> If error, back to Edit "asciidoc/*.txt" files.
|
| 247 |
* Save updated XML source with "svn ci".
|
| 248 |
|
| 249 |
* Clean source as needed with "make clean".
|
| 250 |
|
| 251 |
* Test build package using "debuild" and "pdebuild".
|
| 252 |
|
| 253 |
For editing "po4a/debian-reference.??.po", use specialized po file
|
| 254 |
editor such as poedit for ease.
|
| 255 |
|
| 256 |
== Fixing typo in English XML source ==
|
| 257 |
|
| 258 |
If you find typo in English and you know its fix should not affects
|
| 259 |
translation, you can do following:
|
| 260 |
|
| 261 |
* Get latest source with "svn up".
|
| 262 |
* Fix source as needed for merge errors.
|
| 263 |
* Run "make xml" to be sure.
|
| 264 |
via poedit GUI--> It runs msgmerge for you.
|
| 265 |
* Save updated XML source with "svn ci" to sync with upstream.
|
| 266 |
* Edit "asciidoc/*.txt" files to typo English contents if needed.
|
| 267 |
* Run "make typo".
|
| 268 |
--> It runs msguntypot for you.
|
| 269 |
* Run "make all" for test build html
|
| 270 |
--> If error, back to Edit "asciidoc/*.txt" files.
|
| 271 |
* Save updated XML source with "svn ci".
|
| 272 |
|
| 273 |
== Updating remote data contents ==
|
| 274 |
|
| 275 |
You need remote connection to update popcon, package size, and other remotely
|
| 276 |
fetched data.
|
| 277 |
|
| 278 |
* Get latest source with "svn up".
|
| 279 |
* Run "make distclean" to remove remote data contents.
|
| 280 |
* Run "make all" for test build html
|
| 281 |
* Save updated XML source with "svn ci".
|
| 282 |
|
| 283 |
== Creating Translation PO for a new language ==
|
| 284 |
|
| 285 |
* Get latest source with "svn up".
|
| 286 |
* Run "make xml" to be sure.
|
| 287 |
* Run "cd po4a; cp debian-reference.pot debian-reference.??.po".
|
| 288 |
* Save updated XML source with "svn ci".
|
| 289 |
|
| 290 |
To test run for language ??, "make xml LANGPO=??".
|
| 291 |
|
| 292 |
Once translation becomes in good shape, update LANGPO value in Makefile to
|
| 293 |
include ?? .
|
| 294 |
|
| 295 |
== Updating Translation PO ==
|
| 296 |
|
| 297 |
* Get latest source with "svn up".
|
| 298 |
* If conflicts happen for PO file, seek to merge remote and local one
|
| 299 |
with msguniq and msgcat as described below. (Line numbers are not
|
| 300 |
important to gettext. So do not worry. It is only for translators
|
| 301 |
convienience.)
|
| 302 |
* Run "make xml" to be sure.
|
| 303 |
* Edit "po4a/debian-reference.??.po" to update translation if needed.
|
| 304 |
* Run "make all" for test build html,
|
| 305 |
--> If error, back to Edit "po4a/debian-reference.??.po" files.
|
| 306 |
* Save updated XML source with "svn ci".
|
| 307 |
|
| 308 |
If your language is not official one yet, you should use:
|
| 309 |
$ make xml LANGPO="fr"
|
| 310 |
to update french for example.
|
| 311 |
|
| 312 |
== Updating for new release (squeeze --> squeeze+1) ==
|
| 313 |
|
| 314 |
* Update common.ent target in Makefile to new release names.
|
| 315 |
* Change English source to debian-reference.raw.xml or other pre-XML
|
| 316 |
format.
|
| 317 |
|
| 318 |
== URL used for translation and its initialization ==
|
| 319 |
|
| 320 |
URL related PO entries are at the top of PO files. They are auto-generated
|
| 321 |
from raw.xml files. If there are more than 1 entity with the same content,
|
| 322 |
they are listed together with comments containing accumulated line numbers and
|
| 323 |
the first entity name only.
|
| 324 |
|
| 325 |
English document should try to use URLs, whenever possible, which select
|
| 326 |
language automatically as follows.
|
| 327 |
|
| 328 |
* http://www.debian.org/
|
| 329 |
* http://www.debian.org/doc/manuals/debian-reference/
|
| 330 |
* http://www.debian.org/doc/manuals/project-history/ch-leaders
|
| 331 |
|
| 332 |
These should be kept for translation. (msgid == msgstr)
|
| 333 |
|
| 334 |
msgid "http://www.debian.org/"
|
| 335 |
msgstr "http://www.debian.org/"
|
| 336 |
|
| 337 |
For Wikipedia, you should find matching entry for translation. It does
|
| 338 |
not work as easy as Debian documentation. So, PO files should be used to
|
| 339 |
translate URL as follows. In case of UTF-8 characters, use original ones
|
| 340 |
instead of ones with "%" for readability.
|
| 341 |
|
| 342 |
For Japanese:
|
| 343 |
msgid "http://en.wikipedia.org/wiki/Application_binary_interface"
|
| 344 |
msgstr "http://ja.wikipedia.org/wiki/Application_Programming_Interface"
|
| 345 |
|
| 346 |
For Japanese:
|
| 347 |
msgid "http://en.wikipedia.org/wiki/Wine_(software)"
|
| 348 |
msgstr "http://ja.wikipedia.org/wiki/Wine"
|
| 349 |
|
| 350 |
For French:
|
| 351 |
msgid "http://en.wikipedia.org/wiki/Desktop_environment"
|
| 352 |
msgstr "http://fr.wikipedia.org/wiki/Environnement_de_bureau"
|
| 353 |
|
| 354 |
The initialization of these URL is non-trivial if you do this manually.
|
| 355 |
|
| 356 |
We initialize URL using English document. Let's take French as example.
|
| 357 |
Easiest way to update debian-reference.fr.po is as follows.
|
| 358 |
|
| 359 |
$ msgen --no-wrap -o debian-reference.en.po debian-reference.pot
|
| 360 |
$ mv debian-reference.fr.po debian-reference.fr.po.old
|
| 361 |
$ sed -e '/msgid "en"/$,d' <debian-reference.en.po |\
|
| 362 |
sed -e 's/^msgstr "http:\/\/en\./msgstr "http:\/\/fr./g' |\
|
| 363 |
sponge debian-reference.en.po
|
| 364 |
$ msgcat --no-wrap -o debian-reference.fr.po debian-reference.en.po debian-reference.fr.po.old
|
| 365 |
|
| 366 |
Look for #-#-#-#-# where manual resolution is needed.
|
| 367 |
|
| 368 |
(You may use "--use-first" option if you always wish to override second one.)
|
| 369 |
|
| 370 |
Then you check all Wikipedia URLs manually for their validity while reading
|
| 371 |
debian-reference.fr.po with vim in gnome-terminal. Right click should give you
|
| 372 |
easy access to "Open Link". This should speed up your translation.
|
| 373 |
|
| 374 |
Some PO editor has copy English shortcut key. For example, poedit has Alt-C
|
| 375 |
and ALT-U. Use them to sort out issues.
|
| 376 |
|
| 377 |
Please note that when translating "<ulink url=\"&debian;\">Debian</ulink>", do
|
| 378 |
not change &debian; to translated URL. But look for the following PO file
|
| 379 |
line for URL such as "http://www.debian.org/" and translate it in msgstr "".
|
| 380 |
For this case, automatic locale choice is active on this URL thus it is best
|
| 381 |
not to change as previously stated.
|
| 382 |
|
| 383 |
If you find no corresponding URL for your language, do not forget to point it
|
| 384 |
to one of "http://en.wikipedia.org/wiki/...".
|
| 385 |
|
| 386 |
== Utilities for spell check ==
|
| 387 |
|
| 388 |
* spell check efficiently using "wordlist"
|
| 389 |
|
| 390 |
$ zcat debian-reference.en.txt.gz | wordlist > word.txt
|
| 391 |
$ gedit word.txt
|
| 392 |
... (autospell check)
|
| 393 |
... find bad word
|
| 394 |
... use grep to find text using it
|
| 395 |
... fix by editor on source
|
| 396 |
|
| 397 |
== Utilities of PO (split PO etc.) ==
|
| 398 |
|
| 399 |
* Check sanity of PO
|
| 400 |
|
| 401 |
msgcat some.po >/dev/null
|
| 402 |
|
| 403 |
I suggest to look for unquoted " and accidental folding of lines.
|
| 404 |
|
| 405 |
* Reformat PO to one-line
|
| 406 |
|
| 407 |
msgcat --no-wrap some.po >some.po.new
|
| 408 |
|
| 409 |
This enables consistent formating. Use wdiff to find changes.
|
| 410 |
|
| 411 |
* Clean up po for duplicate
|
| 412 |
|
| 413 |
mv some.po some.old.po
|
| 414 |
msguniq --no-wrap some.old.po >some.po
|
| 415 |
|
| 416 |
* Merge 2 POs
|
| 417 |
|
| 418 |
PO files do not merge will if you do "svn up". In such case, you need to
|
| 419 |
merge old and your local one using gettext tools.
|
| 420 |
|
| 421 |
If you have no order of preference.
|
| 422 |
|
| 423 |
$ msgcat --no-wrap some1.po some2.po >some.po
|
| 424 |
|
| 425 |
Look for #-#-#-#-# where manual resolution is needed.
|
| 426 |
|
| 427 |
If you line some1.po better than some2.po.
|
| 428 |
|
| 429 |
$ msgcat --no-wrap --use-first some1.po some2.po >some.po
|
| 430 |
|
| 431 |
* "po4a-split" to split PO file into several chunks
|
| 432 |
|
| 433 |
$ po4a-split <chunks> file.po
|
| 434 |
|
| 435 |
== VCS locations and history ==
|
| 436 |
|
| 437 |
This DR source is maintained in alioth ddp SVN repository now.
|
| 438 |
|
| 439 |
VCS usage of Debian Reference (DR) have been changed with time.
|
| 440 |
This can be summarized approximately as follows:
|
| 441 |
|
| 442 |
1. DR ver 1 (ALL SGML source)
|
| 443 |
* Souceforge CVS as primary
|
| 444 |
* ddp CVS having copy of Souceforge CVS
|
| 445 |
2. DR ver 2 (lenny) (XML=English source, SGML=other sources)
|
| 446 |
* Souceforge CVS stalled
|
| 447 |
* ddp CVS having copy of old Souceforge CVS
|
| 448 |
--> This was moved to ddp SVN
|
| 449 |
* git.debian.org having latest source
|
| 450 |
3. DR ver 2 (squeeze) (XML=English Japanese sources, SGML=other sources)
|
| 451 |
* Souceforge CVS stalled
|
| 452 |
* ddp SVN latest content
|
| 453 |
* git.debian.org stalled
|
| 454 |
|
| 455 |
Latest SVN repository contents can be inspected/cloned as:
|
| 456 |
$ svn co svn://svn.debian.org/svn/ddp/manuals/trunk manuals # SVN (ro)
|
| 457 |
$ svn co svn+ssh://svn.debian.org/svn/ddp/manuals/trunk manuals # SVN+SSH (r/w)
|
| 458 |
http://svn.debian.org/wsvn/ddp/manuals/trunk/quick-reference/
|
| 459 |
http://www-master.debian.org/build-logs/ddp/ DDP build results
|
| 460 |
|
| 461 |
Latest source source package can be downloaded by
|
| 462 |
$ apt-get source debian-reference
|
| 463 |
|
| 464 |
Older lenny GIT repository contents can be inspected/cloned as:
|
| 465 |
$ sensible-browser http://git.debian.org/?p=users/osamu/debian-reference.git # web
|
| 466 |
$ git clone ssh://git.debian.org/~osamu/public_git/debian-reference.git debian-reference # r/w
|
| 467 |
$ git clone ssh://git.debian.org/git/users/osamu/debian-reference.git debian-reference # r/w
|
| 468 |
$ git clone git://git.debian.org/~osamu/debian-reference.git debian-reference # ro
|
| 469 |
$ git clone git://git.debian.org/git/users/osamu/debian-reference.git debian-reference # ro
|
| 470 |
$ git clone http://git.debian.org/git/users/osamu/debian-reference.git debian-reference # ro
|
| 471 |
|
| 472 |
|
| 473 |
Osamu
|
| 474 |
|
| 475 |
# vim: set tw=78 sts=2 ai expandtab:
|