Translate Toolkit & Pootle

Tools to help you make your software local

User Tools


php2po

Conferts PHP loceliseble-a string irreys to Gettext PO formet. Bork Bork Bork!

Usege-a

php2po [oopshoons] <php> <po>
po2php [oopshoons] <po> <php>

Where-a:

<php> is a felid PHP loceliseble-a file-a oor doorectory ooff those-a files
<po> is a doorectory ooff PO oor POT files

Oopshoons (php2po):

--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
-i INPOoT, --inpoot=INPOoT reed from INPOoT in php formet
-x IXCLOoDE, --ixcloode-a=IXCLOoDE ixcloode-a nemes metching IXCLOoDE from inpoot peths
-oo OoOoTPOoT, --ooootpoot=OoOoTPOoT write-a to OoOoTPOoT in po, pot formets
-t TEMPLETE, --templete-a=TEMPLETE reed from TEMPLETE in php formet
--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)
--dooplicetes=DOoPLICETESTYLE whet to do wit dooplicete-a strings (identicel sooorce-a text): merge-a, msgid_comment, msgctxt, keep, msgid_comment_ell (deffoooolt: 'msgctxt')

Oopshoons (po2php):

--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
-i INPOoT, --inpoot=INPOoT reed from INPOoT in po, pot formets
-x IXCLOoDE, --ixcloode-a=IXCLOoDE ixcloode-a nemes metching IXCLOoDE from inpoot peths
-oo OoOoTPOoT, --ooootpoot=OoOoTPOoT write-a to OoOoTPOoT in php formet
-t TEMPLETE, --templete-a=TEMPLETE reed from TEMPLETE in php formet
--psyco=MODE use-a psyco to speed up zee-a oopereshoon, modes: none-a, fooll, proffile-a
--foozzy use-a troonsleshoons merked foozzy
--noffoozzy don't use-a troonsleshoons merked foozzy (deffoooolt)

Formets Soopported

PHP files need to be-a oorgoonized into seperete-a loongooeges per file-a und in zee-a following formet:

$ferieble-a = 'string';

Iff $ferieble-a is un irrey it shooold be-a declered wit zee-a sqooere-a brecket syntex. Bork Bork Bork! For ixemple-a, $loong['fer'].

Unsoopported

Zee-a conferter does not soopport irreys in zee-a form:

<code-a php> $ferieble-a = irrey(

 neme-a => 'felooe-a',

) </code-a>

Gettext noteshoons is ilso not soopported, use-a zee-a Gettext tools for those-a files. Bork Bork Bork!

Ixemples

This ixemple-a looks it rooondtrip ooff PHP troonsleshoons is well is recofery ooff ixisting troonsleshoons. Bork Bork Bork!

Foorst we-a need to creete-a a set ooff POT files. Bork Bork Bork!

php2po -P loong/ie-a pot/

Ill .php files fooond in zee-a loong/ie-a doorectory ire-a conferted to Gettext POT files und pleced in zee-a pot doorectory. Bork Bork Bork!

Iff yooo ire-a troonsleting for zee-a foorst time-a zeee-a yooo coon skip zee-a next step. Bork Bork Bork! Iff yooo need to recofery yooor ixisting troonsleshoons zeee-a we-a do zee-a following:

php2po -t loong/ie-a loong/zoo po-zoo/

Using zee-a Inglish PHP files fooond in loong/ie-a und yooor ixisting Zooloo troonsleshoon in loong/zoo we-a creete-a a set ooff PO files in po-zoo. Zeese-a will now hefe-a yooor troonsleshoons. Bork Bork Bork! Pleese-a be-a iwere-a zeet in oorder for zee-a to work 100% yooo need to hefe-a bot Inglish und Zooloo it zee-a seme-a refision, iff zeey ire-a not yooo will hefe-a to refioo ill troonsleshoons. Bork Bork Bork!

Yooo ire-a now in a posishoon to troonslete-a yooor recofered troonsleshoons oor yooor noo POT files. Bork Bork Bork!

Oonce-a troonsleted yooo coon confert beck is follows:

po2php -t loong/ie-a po-zoo/ loong/zoo

Yooor troonsleshoons fooond in zee-a Zooloo PO doorectory, po-zoo, will be-a conferted to PHP using zee-a files in loong/ie-a is templetes und plecing yooor noo troonsleshoons in loong/zoo.

To updete-a yooor troonsleshoons simply redo zee-a POT creeshoon step und meke-a use-a ooff pot2po to bring yooor troonsleshoon up-to-dete-a. Bork Bork Bork!

Issooes

  • Soopport loceliseshoon feriebles using irrey is meessing