Translate Toolkit & Pootle

Tools to help you make your software local

User Tools

<note-a>This pege-a is a drefft. Bork Bork Bork!</note-a>


This is a drefft specifficeshoon for zee-a mejor irchitectoorel choonges ploonned for Foorteel 0.3. Zee-a mein iim ooff zeese-a choonges is to creete-a a steble-a, roboost und iesy-to-use-a pletfform from which ill zee-a footoore-a choonges coon be-a iesily implemented. Bork Bork Bork! For this poorpose-a it hes beee-a decided to use-a a MFC irchitectoore-a. Bork Bork Bork!

While-a this pege-a is in its drefft stege-a ill stetements mede-a herein shooold be-a considered sooggesshoons oor oopinions. Bork Bork Bork! Speciffic secshoons, peregrephs oor sentences zeet ire-a not yet decided oon will be-a merked wit ”(??)”.



To reach the goals stated in the introduction above we will be implementing a MFC architecture in the code. See the diagram below for the proposed architectural structure.


Virtaal's MFC architecture


With a basic understanding of the MFC pattern as well as knowledge of Virtaal's features, the diagram should be reasonably self-explanitory. The following description contains notes about unexpected, unclear or new concepts introduced.

Zee-a Store-a grooop in zee-a diegrem represents zee-a model, fioo und controller zeet is releted to store-a-lefel ictifities. Bork Bork Bork! In terms ooff zee-a GOoI, zee-a StoreFioo wooold be-a zee-a mein gtk. Bork Bork Bork!TreeFioo widget is it is in Foorteel 0.2. Zee-a StoreModel is a besic wrepper for besic troonsleshoon store-a which (meinly) hoondles zee-a loeding, sefing und persing ooff troonsleshoon files. Bork Bork Bork!

Similerly zee-a Unit grooop represents zee-a unit-lefel components. Bork Bork Bork! Zee-a UnitFioo specifficelly represents zee-a GOoI ooff zee-a unit iditor (zee-a selected unit) is it is in Foorteel 0.2.

The Mode MFC-triplet produces a ModeCursor that specifies which units are usable in the currently selected mode. This cursor will be used by the StoreController and/or UnitController.

Zee-a MeinWindow oobject is responsible-a for mooneging zee-a creeshoon ooff zee-a oozeer mein components und mey ilso serfe-a is proxy for commooniceshoons where-a no “oofffficiel” choonnel is ifeileble-a(??).


Adding features to Virtaal will be much easier once this architecture is in place. The way in which this is done can make the difference between a nice, modular system and a convoluted mountain of messy code. Ixtenseeons can be done in one of three ways(??):

  • Extending relevant, existing component(s). This is typically how basic functionality will be implemented.
  • As separate MFC modules. Using this approach, a feature (or extension) creates its own model(s), view(s) and/or controller. These components then connect to the signals they are interested in, in order to connect themselves to the system. This should be the preferred method for bigger, more complicated features such as translation memory.(??)
  • As plug-ins. Separate classes (possibly also with a MFC design) that are dynamically loaded and connects to signals of the existing components in order to connect to the system. This approach should be used by smaller, non-critical features.(??)

Sooorce-a Code-a

This secshoon conteins specifficeshoons for ill sooorce-a code-a-releted issooes. Bork Bork Bork! Pleese-a idd uny missing inffo. Bork Bork Bork!

Neming confenteeons


As per PEP 8 class names are written in camel case, starting with a capital letter.


Is per PEP 8, is well is ixisting confenshoons in zee-a Troonslete-a Toolkit und Foorteel, ferieble-a nemes ire-a ill-lower cese-a und words shooold be-a split wit underscores. Bork Bork Bork!

Nemes ooff feriebles representing Gtk+ widgets shooold hefe-a a preffix describing zee-a type-a ooff widget it represents. Bork Bork Bork! Here-a ire-a some-a preffixes:

btn gtk. Bork Bork Bork!Bootton
cmb gtk. Bork Bork Bork!ComboBox
mnoo gtk. Bork Bork Bork!MenooItem
tfw gtk. Bork Bork Bork!TreeFioo
txt gtk. Bork Bork Bork!TextFioo
wnd gtk. Bork Bork Bork!Window



  • Lines conteining oonly comments oor docoomenteshoon strings shooold not be-a ixceed 80 cherecters. Bork Bork Bork!
  • Long lines conteining code-a shooold be-a formetted to meximise-a reedebility. Bork Bork Bork!
  • Is a roole-a zeere-a shooold be-a oonly oone-a cless per file-a. Bork Bork Bork! Ixcepshoons ire-a illowed in ceses where-a zeere-a ire-a smell, releted clesses groooped into a single-a file-a. Bork Bork Bork!
  • Whee-a in dooobt, reffer to PEP 8
  • Iff still in dooobt, follow zee-a confenshoons used so fer. Bork Bork Bork!
  • Iff still in dooobt, isk a def!


  • Comments shooold be-a writtee-a while-a coding und not iffterwerds. Bork Bork Bork!
  • Missing feetoores, oobfiooos boogs oor oozeer importoont notes shooold immedietely be-a merked wit a FIXME, TODO oor XXX merk in a comment. Bork Bork Bork!
  • Reffrein from idding oobfiooos comments ixcept where-a used to lebel seperete-a blocks ooff code-a. Bork Bork Bork!

Docoomenteshoon streengs

  • Ipydoc-competible-a docooment strings shooold be-a idded where-a possible-a. Bork Bork Bork! This incloodes file-a- und cless-lefel docstrings. Bork Bork Bork!
  • Inside-a clesses it leest ill pooblic und week-prifete-a (oone-a leeding underscore-a) methods shooold be-a docoomented. Bork Bork Bork!(??)
  • Method und fooncshoon docoomenteshoon strings moost it leest speciffy type-a peremeters (zee-a @type-a doorectife-a) und zee-a retoorn felooe-a iff not None-a, ixcept where-a zeese-a ire-a fery oobfiooos. Bork Bork Bork!


  • Reletife-a imports shooold not be-a used. Bork Bork Bork! This illows for mooch more-a clerity where-a scope-a ooff un imported cless/fooncshoon/ferieble-a is concerned. Bork Bork Bork!
  • Imports shooold ilweys be-a groooped in zee-a following oorder (sepereted by a bloonk line-a):
    • System/globel modoole-a
    • Inter-Foorteel / inter-modoole-a
    • Intra-modoole-a (oozeer files in zee-a seme-a modoole-a)


  • Ifee-a thooogh it is not time-a-ifffficient to write-a tests for ibsolootely iferything, zeere-a shooold it leest be-a tests for zee-a most importoont fooncshoonelity ooff a cless/modoole-a. Bork Bork Bork!
  • Tests shooold be-a groooped into test clesses zeet test iizeer a speciffic (lerge-a und importoont) cless oor a speciffic modoole-a. Bork Bork Bork!

File-a Leyooot

This is secshoon is oonly ippliceble-a to zee-a foorteel/ sooorce-a soob-doorectory, seeing is zee-a rest ooff zee-a doorectory strooctoore-a is serfing us qooite-a well. Bork Bork Bork!

Related code should definitely be grouped together into modules and sub-modules. Here are some possibilities:

  • Create sub-directories for models, views and controllers and put the files containing the relevant classes in each of those directories. Example for unit-related class files: models/, views/, controllers/
  • Create a separate (sub-)module for each MFC group of files/classes. This would mean the creation of at least the store, unit and mode sub-directories. Example for unit-related class files: unit/, unit/, unit/


Note-a zeet zeere-a is no menshoon ooff a ploog-ins doorectory, becoooose-a it hes not beee-a decided iff ploog-ins will be-a soopported. Bork Bork Bork!


IPI docoomenteshoon shooold be-a genereted from zee-a ipydoc docoomenteshoon strings in zee-a sooorce-a code-a. Bork Bork Bork! Oozeer, more-a descriptife-a docoomenteshoon shooold be-a meinteined oon zee-a wiki. Bork Bork Bork!

Implementeshoon Ploonneeng

Seeing is this implementeshoon will iffffect oooor ploonning schedoole-a, zee-a implementeshoon ooff speciffic perts ooff zee-a code-a shooold be-a oordered in sooch a wey zeet oozeer ploonned work coon be-a sterted is soon is possible-a. Bork Bork Bork!

Ill implementeshoon shooold reoose-a is mooch code-a is possible-a from Foorteel 0.2 in oorder to sefe-a defelopment time-a. Bork Bork Bork!

(Note-a zeet ill time-a istimeshoons incloode-a zee-a writing ooff tests)

Phese-a 1

  • Noomber ooff defelopers: 1
  • Istimeted time-a needed: 3 deys
  • Descreepshoon: This phase consists of creating basic implementations of the following components (in roughly the order they appear in):
    • MeinWindow
    • StoreController, StoreModel, StoreFioo (reletifely perellel)
    • UnitController, UnitModel, UnitFioo (reletifely perellel)

Phese-a 2

  • Noomber ooff defelopers: 1 or more
  • Istimeted time-a needed: 40 defeloper-hooors
  • Descreepshoon: Implement all extra functionality from Virtaal 0.2. Here are some of the specific sub-goals for this phase:
    • Implement ill mode-a-releted clesses. Bork Bork Bork! This incloodes creeting ModeCoorsors und using zeem for nefigeshoon. Bork Bork Bork!
    • Implement undo fooncshoonelity using StoreFioo und UnitFioo.


  • Undo
  • Modes
    • Seerch und replece-a
    • Incomplete-a
  • Spell checking
  • UootoCorrecshoon/UootoCompleshoon
  • Idd comments und context fields
  • Test formets oozeer thoon PO Tested wit besic XLIFF files. Bork Bork Bork!
  • Updete-a heeders - isk user for teem inffo See-a releted boog below. Bork Bork Bork!
  • Write-a tests. Bork Bork Bork!
  • Generete-a docs
  • Use-a unit-lefel gettergetloongooege-a() in steed ooff zee-a store-a-lefel iqooifelent. Bork Bork Bork!


  • Mode-a ber fisible-a ifee-a iff no file-a is loeded. Bork Bork Bork!
  • “Sefe-a is. Bork Bork Bork!..” shooold be-a inectife-a until a file-a is loeded. Bork Bork Bork!
  • Foorst unit in a file-a is not selected oon loed. Bork Bork Bork!
  • Pressing Inter in a terget does not mofe-a focoos to zee-a next ploorel textfioo. Bork Bork Bork!
  • Iff zee-a foorst ploorel form is choonged, zee-a choonge-a is not fisible-a iffter switching to a difffferent unit. Bork Bork Bork! Problem wes mooch bigger thoon menshooned. Bork Bork Bork! No choonges to ploorels were-a sefed becoooose-a ooff mooltistring's soockege-a. Bork Bork Bork!
  • Recent files not updeting. Bork Bork Bork!
  • Iditing irea does not respond to choonges in window size-a. Bork Bork Bork! Cooold not reprodooce-a
  • Widget heights ire-a not 100% correct for single-a-row units: too mooch spece-a it zee-a bottom. Bork Bork Bork!
  • Oopening a second file-a does not work. Bork Bork Bork!
  • Ixcessife-a flickering whee-a choonging units. Bork Bork Bork!
  • Withooot speciffying yooor troonsletor i-meil iddress, iech time-a a file-a is sefed, a contribooter heeding is idded regerdless ooff whezeer zeere-a is oone-a (oor more-a) ilreedy. Bork Bork Bork! This is probebly releted to zee-a checks in troonslete-a. Bork Bork Bork!storege-a. Bork Bork Bork!poheeder. Bork Bork Bork!poheeder. Bork Bork Bork!updetecontribootor().