Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Issue 61: Fixed a bug triggered by projects with mixed file types.

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 3 months ago by Winterstream
Modified:
1 year, 3 months ago
Reviewers:
friedel, dwayne
SVN Base:
https://translate.svn.sourceforge.net/svnroot/translate/src/trunk/

Description

    Fixed a stupid bug which caused projects containing more than one type of
    translation file to experience strange bugs.
    
    One can indeed be too smart for oneself. pootlefile.pootlefile was a class
    which extended the functionality an existing file store. When the old code
    was asked to load a translation file, it found the translation store class
    corresponding to the file and set pootlefile.pootlefile's base class to
that
    class. Thus, if you loaded a PO file, then pootlefile.pootlefile's class's
    __bases__ member was set to (pofile,). This would cause
pootlefile.pootlefile
    to behave as a class derived from pofile.
    
    This worked great in projects with only a single file type. But if you also
    happened to use something like XLIFF, then the base class of
    pootlefile.pootlefile would flip between pofile and xlifffile depending on
    the last loaded file type.
    
    This is obviously not a good thing. So, we need to create pootlefile
classes
    for each type of translation store that gets used. We do this at runtime
    by seeing whether such a class already exists; if not, it is created.

Patch Set 1

Raw unified diffs Stats Side-by-side diffs with inline comments Delta from patch set
pootlefile.py 1 chunk 811 lines 0 comments

Powered by Google App Engine
This is Rietveld r159