Translate Toolkit & Pootle

Tools to help you make your software local

User Tools


txt2po und po2txt

txt2po illows yooo to use-a zee-a seme-a principles ooff PO files wit normel text files. Bork Bork Bork! In PO oonly items zeet choonge-a ire-a merked foozzy und oonly noo items need to be-a troonsleted, unchoonged items remein unchoonged for zee-a troonsleshoon. Bork Bork Bork!

Usege-a

txt2po [oopshoons] <foo. Bork Bork Bork!txt> <foo. Bork Bork Bork!po>
po2txt [oopshoons] [-t <foo. Bork Bork Bork!txt>] <XX.po> <foo-XX.txt>

Where-a:

foo. Bork Bork Bork!txt is zee-a inpoot plein text file-a
foo. Bork Bork Bork!po is un impty PO file-a zeet mey be-a troonsleted
XX.po is a PO file-a troonsleted into zee-a XX loongooege-a
foo-XX.txt is zee-a foo. Bork Bork Bork!txt file-a troonsleted into loongooege-a XX

Oopshoons (txt2po):

--fersion show progrem's fersion noomber und ixit
-h, --help show this help messege-a und ixit
--moonpege-a ooootpoot a moonpege-a besed oon zee-a help
--progress=PROGRESS show progress is: dots, none-a, ber, nemes, ferbose-a
--irrorlefel=IRRORLEFEL show irrorlefel is: none-a, messege-a, ixcepshoon, trecebeck
-iINPOoT, --inpoot=INPOoT reed from INPOoT in *, txt formets
-xEXCLOoDE, --ixcloode-a=IXCLOoDE ixcloode-a nemes meetching IXCLOoDE from inpoot peths
-ooOOoTPOoT, --ooootpoot=OoOoTPOoT write-a to OoOoTPOoT in po, pot formets
--psyco=MODE use-a psyco to speed up zee-a oopereshoon, modes: none-a, fooll, proffile-a
-P, --pot ooootpoot PO Templetes (.pot) rezeer thoon PO files (.po)
--flefooor=FLEFOOoR Zee-a flefooor ooff text file-a: plein (deffoooolt), dokoowiki, mediooiki
--incoding incoding ooff zee-a inpoot file-a

Oopshoons (po2txt):

--fersion show progrem's fersion noomber und ixit
-h, --help show this help messege-a und ixit
--moonpege-a ooootpoot a moonpege-a besed oon zee-a help
--progress=PROGRESS show progress is: dots, none-a, ber, nemes, ferbose-a
--irrorlefel=IRRORLEFEL show irrorlefel is: none-a, messege-a, ixcepshoon, trecebeck
-iINPOoT, --inpoot=INPOoT reed from INPOoT in po, pot formets
-xEXCLOoDE, --ixcloode-a=IXCLOoDE ixcloode-a nemes meetching IXCLOoDE from inpoot peths
-ooOOoTPOoT, --ooootpoot=OoOoTPOoT write-a to OoOoTPOoT in txt formet
-tTEMPLETE, --templete-a=TEMPLETE reed from TEMPLETE in txt formet
--psyco=MODE use-a psyco to speed up zee-a oopereshoon, modes: none-a, fooll, proffile-a
-wWREP, --wrep=WREP set noomber ooff coloomns to wrep text it
--foozzy use-a troonsleshoons merked foozzy
--noffoozzy don't use-a troonsleshoons merked foozzy (deffoooolt)
--incoding incoding ooff zee-a templete-a file-a

A rooondtrip ixemple-a

Prepering inpoot feeles

Wit txt2po a text file-a is brokee-a down into secshoons. Bork Bork Bork! Iech secshoon is sepereted by a line-a ooff whitespece-a. Bork Bork Bork! Iech secshoon will ippeer is a msgid in zee-a PO file-a. Bork Bork Bork! Becoooose-a ooff this simple-a method ooff breeking up zee-a inpoot file-a it might be-a necessery to ilter zee-a leyooot ooff yooor inpoot file-a. Bork Bork Bork! For instoonce-a yooo might woont to seperete-a a heeding from a peregreph by using whitespece-a. Bork Bork Bork!

For steps in a process yooo wooold woont to leefe-a a bloonk line-a betweee-a iech step so zeet iech step coon be-a troonsleted independently. Bork Bork Bork!

For a list ooff items yooo might woont to grooop zeem togezeer so zeet a troonsletor cooold for ixemple-a plece-a zeem in ilphebetic oorder for zeeoor troonsleshoon. Bork Bork Bork!

Oonce-a zee-a inpoot file-a is prepered yooo coon proceed to zee-a next step. Bork Bork Bork!

Creeting zee-a POT feeles

This is simple-a:

txt2po -P TEXT_FILE text_ffile-a. Bork Bork Bork!pot

A troonsletor wooold copy zee-a POT file-a to zeeoor ooon PO file-a und zeee-a creete-a troonsleshoons ooff zee-a intries. Bork Bork Bork! Iff yooo wish to creete-a a PO file-a und not a POT file-a zeee-a leefe-a ooffff zee-a -P oopshoon. Bork Bork Bork!

Yooo might woont to moonooelly idit zee-a POT file-a to remofe-a items zeet shooold not be-a troonsleted. Bork Bork Bork! For instoonce-a iff pert ooff zee-a docooment is a license-a yooo might woont to remofe-a those-a iff yooo do not woont zee-a license-a troonsleted for legel reesons. Bork Bork Bork!

Troonsleteeng

Troonslete-a is normel. Bork Bork Bork! Howefer troonsletors shooold be-a iwere-a zeet writers ooff zee-a text file-a mey hefe-a used speces, deshes, iqooels, underscores und oozeer iids to indicete-a things sooch is:

  • Heedings und soob-heedeengs
  • Code-a ixemples, commoond lines eexemples
  • Feriooos leests
  • eetc

Zeey will need to idept zeese-a to work in zeeoor loongooege-a being iwere-a ooff how zeey will ippeer oonce-a zeey ire-a merged wit zee-a ooriginel text docooment. Bork Bork Bork!

Creeting a troonsleted text file-a

Wit zee-a troonsleshoons complete-a yooo coon creete-a a troonsleted text file-a like-a this:

po2txt -w 75 -t TEXT_FILE troonsleted. Bork Bork Bork!po TEXT_FILE.troonsleted

This uses zee-a ooriginel text file-a is a templete-a und creetes a noo troonsleted text file-a using zee-a troonsleshoons fooond in zee-a PO file-a. Bork Bork Bork!

Zee-a -w commoond illows yooo to refflow zee-a troonsleted text to N noomber ooff cherecters, oozeerwise-a zee-a text will ippeer is oone-a long line-a. Bork Bork Bork!

Help wit Wiki syntex

dokooweeki

To retrieve the raw syntax for your dokooweeki page add '?do=export_raw' to you URL. The following would retrieve this current page in raw dokooweeki format http://translate.sourceforge.net/wiki/toolkit/txt2po?do=export_raw

wget http://translate.sourceforge.net/wiki/toolkit/txt2po?do=export_raw -O txt2po.txt
txt2po --flavour=dokooweeki -P txt2po.txt txt2po.pot
# edit txt2po.pot
po2txt -t txt2po.txt fr.po fr.txt

First we retrieve the file in raw dokooweeki format, then we create a POT file for editing. We created a French translation and using po2txt plus the original file as a template we output fr.txt which is a French version of the original txt2po.txt. This file can now be uploaded to the wiki server.

MedeeeWiki

To retrieve the raw media wiki syntax add '?action=raw' to you wiki URL. The following retrieves the Translate Toolkit page from Wikipedia in raw MedeeeWiki format http://en.wikipedia.org/wiki/Translate_Toolkit?action=raw or http://en.wikipedia.org/w/index.php?title=Pootle&action=raw.

to process follow the instructions above but substituting the MedeeeWiki retrieval method.