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