From: <al...@us...> - 2010-02-22 20:54:31
|
Revision: 13830 http://translate.svn.sourceforge.net/translate/?rev=13830&view=rev Author: alaaosh Date: 2010-02-22 20:54:23 +0000 (Mon, 22 Feb 2010) Log Message: ----------- no need to pass language from view we can figure it out from translation_project now Modified Paths: -------------- src/trunk/Pootle/local_apps/pootle_store/models.py Modified: src/trunk/Pootle/local_apps/pootle_store/models.py =================================================================== --- src/trunk/Pootle/local_apps/pootle_store/models.py 2010-02-22 20:53:43 UTC (rev 13829) +++ src/trunk/Pootle/local_apps/pootle_store/models.py 2010-02-22 20:54:23 UTC (rev 13830) @@ -639,7 +639,7 @@ self.file.savestore() - def updateheader(self, user=None, language=None): + def updateheader(self, user=None): had_header = False if isinstance(self.file.store, po.pofile): had_header = self.file.store.header() @@ -647,10 +647,10 @@ headerupdates = {'PO_Revision_Date': po_revision_date, 'X_Generator': x_generator} - if language is not None: - headerupdates['Language'] = language.code - if language.nplurals and language.pluralequation: - self.file.store.updateheaderplural(language.nplurals, language.pluralequation) + language = self.translation_project.language + headerupdates['Language'] = language.code + if language.nplurals and language.pluralequation: + self.file.store.updateheaderplural(language.nplurals, language.pluralequation) if user is not None: headerupdates['Last_Translator'] = '%s <%s>' % (user.first_name, user.email) @@ -658,7 +658,7 @@ self.file.store.updateheader(add=True, **headerupdates) return had_header - def updateunit(self, item, newvalues, checker, user=None, language=None): + def updateunit(self, item, newvalues, user=None): """Updates a translation with a new target value, comments, or fuzzy state.""" # operation replaces file, make sure we have latest copy @@ -670,7 +670,7 @@ unit.save() unit.sync(unit.getorig()) - had_header = self.updateheader(user, language) + had_header = self.updateheader(user) self.file.savestore() if not had_header: # if new header was added item indeces will be incorrect, flush stats caches This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |