On Mon, 2010-03-01 at 14:33 +0900, Martin André wrote: > Hi, > > Thanks for your answer, it was really helpful. See more details inline. > > On 02/26/2010 01:40 AM, Alaa Abd El Fattah wrote: > > On Thu, 25 Feb 2010 14:16:17 +0900 > > Martin André<[email protected]> wrote: > > > >> Is there an easy method to tell Pootle that my files have to be > >> processed through po2prop before the commit? > > > > yes there is Mozilla contributed a "hooks" feature to pootle where you > > can write scripts to be run before or after certain events. > > > > you need to create a python file inside the pootle/scripts/ directory. > > with filename being the same as your project code. > > I was wondering how to use these hooks, now I have the answer :) > Maybe a page on the wiki will be helpful?
Always :) Would you be able to write it, even a basic guide is useful and others can help to flesh it out. > > functions inside that file named after the hooks get called when the > > corresponding event happens (initialize, precommit, postcommit, > > preupdate or postupdate). > > > > check pootle/scripts/sumo.py for example hooks and > > pootle/scripts/hooks.py for the implementation details. > > I've modified sumo.py to my needs. Works well. However, there is a small > problem in local_apps/pootle_app/models/translation_project.py. The > result of the "preupdate" hook is ignored and the wrong file is updated > (the internal pootle file, not in version control). As a quick hack, > I've simply changed the call to: > filetoupdate = hooks.hook(self.project.code, "preupdate", store.file.path) > > I've no experience in python, so I won't be able submit a proper patch. Could you report a bug at locamotion.org, otherwise I worry that we lose track of this as a bug. > > we never used this feature in translate (though we think it's a cool > > idea) and we don't actively test it. so hopefully someone from mozilla > > will offer some help here. > > > > on a longer term these hooks won't be needed for properties files, > > the upcoming 2.1 version of Pootle will support Java properties as well > > as php arrays, QT ts, TMX, TBX and various subtitles formats. > > > > you can already test this functionality by checking latest svn trunk, > > but it is still far from ready. (feedback and patches are most > > welcome :-) > > Awesome! I've just played a bit with this new functionality, looks very > promising. Glad you like it :) -- Dwayne Bailey Associate Research Director +27 12 460 1095 (w) Translate.org.za ANLoc +27 83 443 7114 (c) Recent blog posts: * Translate Toolkit - a powerful localisation toolkit http://www.translate.org.za/blogs/dwayne/en/content/translate-toolkit-powerful-localisation-toolkit * The sky's the limit for new Zulu spell checker * Everyone has the power to champion their language Firefox web browser in Afrikaans - http://af.www.mozilla.com/af/ African Network for Localisation (ANLoc) - http://africanlocalisation.net/ ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Translate-pootle mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/translate-pootle
