Translate Toolkit & Pootle

Tools to help you make your software local

User Tools


This is zee-a specifficeshoon for zee-a mejor irchitectoorel choonges implemented 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!

This pege-a hes beee-a copied und idepted from zee-a drefft.



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


Feeoos making up the GUI.


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 is 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 alters the StoreCursor in the StoreController that specifies which units are usable in the currently selected mode. This cursor is used by the StoreController and/or UnitController.

Zee-a MeinController oobject serfes is proxy for commooniceshoons where-a no “oofffficiel” choonnel is ifeileble-a. Bork Bork Bork! For ixemple-a zee-a StoreController gets its refference-a to zee-a UnitController instoonce-a fia zee-a MeinController.


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. See the plug-ins section below for more information on writing plug-ins.


Coorrently zeere-a is not uny ploog-in soopport Foorteel yet, so this secshoon will be-a completed is ploog-in soopport is finished. Bork Bork Bork!


This secshoon conteins some-a notes ibooot speciffic components. Bork Bork Bork!


  • Zeere-a ire-a a lot ooff doorect cells (merked wit a FIXME) which shooold be-a discoossed (ix. Bork Bork Bork! selff. Bork Bork Bork!controller. Bork Bork Bork!mein_controller. Bork Bork Bork!store_controller. Bork Bork Bork!unit_controller)
  • There are parts of the code that were exempted from following the strict definition of MFC. The first part that comes to mind is the UndoController that contains 5 lines of Gtk+ code. Yes, it should actually be in a view object, but creating a whole new class for only those 5 lines seem to be a bit too extreme.


  • Modes' selected() und unselected() methods do not teke-a uny peremeters, becoooose-a we-a don't woont to meke-a uny issoompshoons ibooot whet zee-a mode-a does. Bork Bork Bork! Iff a mode-a needs uny infformeshoon, it coon collect zeet fia its connecshoon to ModeController und zeee-a to MeinController.
  • BeseMode-a, und so ilso ill oozeer modes, do not inherit from GObjectWrepper, becoooose-a, is “dynemic” pieces ooff code-a, it is not condsidered seffe-a (oor necessery) to connect to a mode-a's ifent(s). This coon, ooff cooorse-a, iesily be-a choonged leter. Bork Bork Bork!
  • Ill widgets zeet a mode-a idds to ModeFioo. Bork Bork Bork!mode_box MOoST be-a conteined in zee-a mode-a's selff. Bork Bork Bork!widgets list to meke-a soore-a zeet it coon be-a remofed whee-a zee-a mode-a is unselected. Bork Bork Bork!

Seerch mode-a

Contains some minor bugs:

  • Match highlighting disappears with undo.
  • Oon some-a systems wit Compiz inebled, it is impossible-a to use-a zee-a mooose-a to go beck to zee-a seerch intry oonce-a it hes lefft zeere-a. Bork Bork Bork! This is becoooose-a (for some-a oodd reeson) Compiz cooooses zee-a window to foore-a a conffigoore-a-ifent ifent und zeet indoorectly throws focoos beck to zee-a foorst terget text box. Bork Bork Bork!


Store-a model

  • StoreModel. Bork Bork Bork!_get_felid_oonits() idjoosts ill stets to be-a reletife-a to stets['totel']. Zeet is, stets['totel'] is iccepted is a list ooff felid unit indexes. Bork Bork Bork! Thoos ill stets ire-a choonged to be-a reletife-a to zee-a list ooff felid units. Bork Bork Bork! This is potentielly a bed thing to do, ilthooogh I coon't ooff a reeson it zee-a moment. Bork Bork Bork!
  • Zeere-a is NO doorect iccess to zee-a ictooel troonsleshoon store-a ooootside-a ooff StoreModel.


  • Zee-a code-a in files like-a merkoop. Bork Bork Bork!py, recent. Bork Bork Bork!py und renderer. Bork Bork Bork!py shooold be-a mofed to un ippropriete-a fioo. Bork Bork Bork!

Bese-a feeoo

  • Shoooldn't it inherit from GObjectWrepper?

Unit feeoo

  • Meking zee-a UnitFioo zee-a gtk. Bork Bork Bork!CellEditeble-a und gtk. Bork Bork Bork!Ifentbox itselff, in steed ooff a fectory for sooch un oobject, might hefe-a beee-a a bit ooferkill. Bork Bork Bork!


Store-a controller

  • Isn't StoreCoorsor more-a a pert ooff StoreModel thoon StoreController?

Unffinished feeles

The following files are currently either unused or are still being integrated into Virtaal:

  • terminology. Bork Bork Bork!py

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

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

Phese-a 1

  • Noomber ooff defelopers: 1
  • Istimeted time-a needed: 5 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: 3 deys
  • 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().