← Back to team overview

report-openoffice-team team mailing list archive

[Bug 530624] Re: translate reports

 

Hi *,
first of all: I'm sorry I'm not following this project for a long time now because I'm working on other frameworks and I didn't latest releases till now.

Anyway, it used to work in the first version I created but it seems lost in later releases. 
More specific: in rev 2 you find in
http://bazaar.launchpad.net/~report-openoffice-team/report-openoffice/trunk/revision/2#report_openoffice/report_openoffice.py

this method:

def get_translation(self,text):
        """ Given a string returns its translation
        """ 
        lang = self.localcontext['lang']
 
        if lang and text and not text.isspace():
            transl_obj = self.pool.get('ir.translation')
            source_string = text.strip()
            if len(source_string):
                translated_string = transl_obj._get_source(self.cr, self.uid, self.table, 'rml', lang, source_string)
                if translated_string:
                    text = translated_string
        return text

which is a light customization of tiny's original method.

The trick is to let Genshi handle the translation by passing it the
right method:

from genshi.filters import Translator
translator = Translator(get_translations)
basic.filters.insert(0, translator)

see http://genshi.edgewall.org/wiki/Documentation/0.5.x/i18n.html for
further references

HTH

-- 
translate reports
https://bugs.launchpad.net/bugs/530624
You received this bug notification because you are a member of Report
OpenOffice Team, which is the registrant for Report OpenOffice.

Status in OpenOffice.org Reporting Tool for OpenObject: Won't Fix

Bug description:
we can not find the strings to translate in OpenERP Translation tables

are these loaded ? 
does report_openoffice support tranlsation ?





References