I’m find a lot of bug on code about translation. I’m correcting some, but I think it should be good to make a guideline document with examples with dos and don’ts to avoid cases like this one:
this.page_title = ('Report')+ ': ' + __(this.docname ? (this.doctype + ' - ' + this.docname) : this.doctype);
if this.docname is defined the string will not be translates because it will try to translate example: “ToDO - anything” and that doesn’t exist in translations.
I believe with guidelines, most of this cases will not be created anymore.