translate / translate

Useful localization tools with Python API for building localization & translation systems
https://toolkit.translatehouse.org/
GNU General Public License v2.0
843 stars 310 forks source link

po2ts after ts2po isn't symmetric #254

Closed transl8bzimport closed 17 years ago

transl8bzimport commented 17 years ago

Version: 0.11

Originally posted by Dave Neary:

Here's a very simple part of a .ts file:

MyClass Translate me

After running this through ts2po, we end up with:

: MyClass#1

msgid "Translate me" msgstr ""

And after re-running through po2ts, we end up with:

MyClass Translate me

which isn't the same thing. In fact, my translations don't get found after this operation.

Shouldn't po2ts respect the text nodes and not add extra whitespace to them?

dwaynebailey commented 17 years ago

Using the snippet that you supplied I confirmed that this is fixed in trunk. The changes were too difficult to backport. So you can either run from a snapshot or from Subversion.

Here is the output as produced by po2ts from trunk: <!DOCTYPE TS>

MyClass Translate me Vertaal my

As you can see text nodes are now not wrapped.

transl8bzimport commented 17 years ago

Originally posted by Dave Neary:

Before closing this bug, can you make a release, or add some documentation on how to install from svn, please?

I just got the sources with svn co https://translate.svn.sourceforge.net/svnroot/translate/src/trunk translate

in the translate directory, running setup.py gives: ./setup.py --help Traceback (most recent call last): File "./setup.py", line 368, in ? standardsetup("translate-toolkit", translateversion) File "./setup.py", line 326, in standardsetup datafiles = getdatafiles() File "./setup.py", line 245, in getdatafiles docfiles.append(listfiles(join('translate', 'doc'))) File "./setup.py", line 238, in listfiles return join(sitepackages, srcdir), [join(srcdir, f) for f in os.listdir(srcdir) if os.path.isfile(join(srcdir, f))] OSError: [Errno 2] No such file or directory: 'translate/doc'

transl8bzimport commented 17 years ago

Originally posted by Dave Neary:

Tested with the tip of the trunk (I ran /translate/convert/po2ts directly) with the same result.

Is it possible that this is coming from another dependency?

I also had a look at the changelog since the 0.11 release (which I also tested), and nothing significant seems to have changed in the ts storage model or the po2ts filter - what change in particular werer you thinking of?

Dave.

dwaynebailey commented 17 years ago

(In reply to BZ-IMPORT::comment #2)

Before closing this bug, can you make a release, or add some documentation on how to install from svn, please?

I just got the sources with svn co https://translate.svn.sourceforge.net/svnroot/translate/src/trunk translate

in the translate directory, running setup.py gives: ./setup.py --help Traceback (most recent call last): File "./setup.py", line 368, in ? standardsetup("translate-toolkit", translateversion) File "./setup.py", line 326, in standardsetup datafiles = getdatafiles() File "./setup.py", line 245, in getdatafiles docfiles.append(listfiles(join('translate', 'doc'))) File "./setup.py", line 238, in listfiles return join(sitepackages, srcdir), [join(srcdir, f) for f in os.listdir(srcdir) if os.path.isfile(join(srcdir, f))] OSError: [Errno 2] No such file or directory: 'translate/doc'

You've picked up a different problem here. Our bad.

You can try run: ./setuppath Then . setpath Then po2ts and friends

That should work for now as a workaround to this problem. And no not going to leave this open until a release. As the bug is fixed and I'd prefer not to have to recheck all of the open bugs when we release 1.0.

dwaynebailey commented 17 years ago

(In reply to BZ-IMPORT::comment #3)

Tested with the tip of the trunk (I ran /translate/convert/po2ts directly) with the same result.

Is it possible that this is coming from another dependency?

I also had a look at the changelog since the 0.11 release (which I also tested), and nothing significant seems to have changed in the ts storage model or the po2ts filter - what change in particular werer you thinking of?

Dave.

My guess is that unless you do the setpath hint above that you will be using minidom classes instead of the adapted classes (ourdom) that are part of the toolkit.

Can you try setpath and see if that sorts things out please.

transl8bzimport commented 17 years ago

Originally posted by Dave Neary:

I can see looking at the trunk that you've solved this by superclassing minidom & implementing the proposed behaviour in ourdom.

I'll follow the setpath tip - is there anything in particular I can do to install this system-wide?

Thanks, Dave.

friedelwolff commented 17 years ago

(In reply to BZ-IMPORT::comment #2)

...

OSError: [Errno 2] No such file or directory: 'translate/doc'

I just commited the doc/ directory to trunk. Hopefully the normal installation from svn trunk should work now.

transl8bzimport commented 17 years ago

Originally posted by Dave Neary:

Thanks a lot :)

I had worked around it by copying the doc dir from 0.11.

transl8bzimport commented 17 years ago

Originally posted by Dave Neary:

Hi again,

You didn't include the api directory recursively - the install script still complains.

Dave.

transl8bzimport commented 17 years ago

Originally posted by Andreas Pauley:

The setup.py script (together with some default doc files) has been modified to allow installation directly from subversion checkout. Revision 5356 in trunk.