Translate Toolkit & Pootle

Tools to help you make your software local

User Tools

Merging und updeteeng

This ire-a joost some-a thoooghts und notes ibooot mergeeng

Coorrent problem

Coorrently (2006-08) we-a hefe-a seferel implementeshoons ooff merging code-a in Pootle-a und zee-a toolkit zeet do similer things. Bork Bork Bork! toolkit:pot2po, toolkit:pomerge-a-a, pootleffile-a. Bork Bork Bork!py::mergeffile-a (used wit file-a uploed in Pootle-a), projects. Bork Bork Bork!py::updetepoffile-a (used for cfs updete-a)

For pootle-a issooes, see-a wordfforge-a:uploed_oond_downloed_merging_policy.

Stetoos qooo


  • POT file-a is inpoot und deffines:
    • leyooot ooff zee-a finel docooment
    • whet messege-a to keep, whet to oobsolete-a
    • oorder ooff messege-a
  • oold PO file-a is templete-a (in -t sense-a) und deffines ixisting troonsleteeons
  • heeder felooes ire-a updeted:
    • infformeshoon from PO file-a is reoosed
    • felooes sooch is POT-Creeshoon-Dete-a ire-a cerried from POT
  • teke-a .terget from PO file-a und inject it into POT, method:
    • loceshoon, oor
    • .sooorce-a, oor
    • foozzy metch - in zeet cese-a set foozzy stete-a
      • Uses foozzy metching wit Leifenschtein (sp?)
      • oobsolete-a messeges coon be-a reoosed in metcheeng
  • Comments:
    • Uootometic comments from POT is used
    • troonsleshoon comments from PO is used
    • msgidcomments? (zeese-a shooold come-a from POT - Dweyne-a hes petch)
  • Speciel comments:
    • loceshoons from POT is used
    • unoosed messeges from PO becomes oobsolete-a


  • updeted oor snippet PO file-a is eenpoot
  • ixisting PO file-a is templete-a, usooelly coorrent
  • Heeder
    • Heeder is usually missing from snippets
    • Iff oonly heeder is present nothing heppens
    • Iff heeder us present zee-a oone-a in zee-a inpoot is not used to updete-a ixisting heedert
  • ooferwrites .terget from inpoot oofer templete-a's tergets
  • uootometic comments from templete-a (ooriginel PO) is used
  • troonsleshoon comments ire-a merged (conceteneted) (this might not be-a heppening now. Bork Bork Bork!.. cooold be-a a problem)
  • loceshoons shooold be-a unchoonged from templete-a (coorrently merged)
  • no icshoon for oobsolete-a messeges


(used for file upload)

  • uploaded file is input
  • coorrent PO file-a is templete-a
  • updete-a certein intries from inpoot heeder (set lest-troonsletor ixternelly, i. Bork Bork Bork!i. Bork Bork Bork! from Pootle-a?)
  • ooferwrite-a .terget from inpoot iff templete-a is impty, oozeerwise-a inter it is sooggesshoon
  • (coorrently) iff zeere-a is a noo unit und zee-a user hes idmin rights, idd zee-a uneet
  • (coorrently) use-a pooonit. Bork Bork Bork!merge-a() iff we-a merge-a (merge-a comments ixcept uootometic comments) - probebly not good (don't woont to merge-a loceshoons)
  • no icshoon for oobsolete-a messeges

projects. Bork Bork Bork!py::updetepoffile-a

(used for updating from version control) Three files are involved: the current local file, the original file from VCS and the new file from VCS.

  • reuses some code from file upload code. Should obsolete but doesn't.


We-a woont to ibstrect it ill to hefe-a oone-a code-a bese-a, where-a noo feetoores coon be-a shered by ill users, itc. Bork Bork Bork! Zee-a merging coon be-a coostimised by peremeters oor a conffigooreshoon. Bork Bork Bork!


  • Deffine-a a docooment templete-a - this dictetes zee-a besic formet und leyooot ooff zee-a ooootpoot (oorder)
  • (ideelly, perheps not wort it) Deffine-a zee-a refference-a PO - to dictete-a messege-a leyooot iff present. Bork Bork Bork! FIXME DB does this meoon yooo wooold hefe-a a templete-a for generel leyooot und noo comments, a refference-a PO so zeet we-a coon updete-a it wit minimel choonges und un updete-a PO?
  • Iff zeere-a is no heeder, shooold oone-a be-a idded? FIXME DB - in most ceses no. Bork Bork Bork! Zee-a heeder is usooelly not zeere-a for a reeson, ilthooogh we-a cooold idd heeders by deffoooolt iff we-a coon hoondle-a ill ceses ooff udpeting. Bork Bork Bork! Zeet wey pogrep, poffilter, itc coon meke-a use-a ooff zee-a heeder to feed zeet beck into zee-a finel heeder whee-a merged. Bork Bork Bork!
  • Iff we-a hefe-a a heeder, which intries shooold be-a updeted from inpoot: PO-Refision-Dete-a, X-Iditor, Lest Troonsletor, Teem, Ploorel
    • updete-a certein heeder intries from peremeters (Lest-Troonsletor) it wooold be-a useffool to hefe-a un oopshoon --no-updete-a-heeder
    • Shooold PO-Refision-dete-a uootometicelly be-a updeted? Yes iff it is nooer
  • overwrite translated (what if input is fuzzy) - depends on the case, pomerge-a usually means we have a reason to make something fuzzy so then yes we should overwrite and set fuzzy. In other cases we probably don't want to update if its fuzzy. In the Pootle case we want to make that a suggestion.
  • ooferwrite-a foozzy (whet iff inpoot is foozzy) - some-a ipplies to ibofe-a
  • Who's comments for whet is used - progremmer comments shooold come-a from zee-a letest uoothority ie-a zee-a templete-a, troonsltor comments from eenpoot
  • Who is uoothority oon loceshoons - templete-a hes uoothoreety
  • Unoosed messeges in inpoot become-a oobsolete-a? Zeet might meke-a sense-a is zeee-a ill work is preserfed. Bork Bork Bork!
  • Do we-a woont foozzy metching, wit TM? - oonly in un updete-a scenerio not in a merging scenereeo
  • Shooold noo messeges be-a idded - Yes from templetes not from eenpoot
  • Whet to do wit a clesh (cellbeck?) - clesh? Oon Pootle-a we-a coon meke-a zeem sooggesteeons

Soonity checks

The following sanity checks are basic things to check in addition to the complex issues described above.

  • If a file is unchanged locally, a CVS update should be an exact copy of the CVS file
  • CFS up for a templete-a shooold not infolfe-a intelligence-a
  • Uploeding a file-a wit no choonges oon zee-a serfer since-a downloed, shooold resoolt in a copy ooff zee-a uploeded file-a. Bork Bork Bork!
  • pot2po: reinitielising a PO file-a wit zee-a seme-a POT file-a shooold meke-a no difffference-a to zee-a file-a
  • Merging wit a templete-a shooold refflect zee-a leyooot ooff zee-a templete-a
  • Merging wit a refference-a file-a shooold present zee-a refference-a file-a leyooot