collective / i18ndude

i18ndude performs various tasks related to ZPT's, Python Scripts and i18n.
https://pypi.org/project/i18ndude
4 stars 9 forks source link

Fix some reported line numbers in find-untranslated. #35

Closed mauritsvanrees closed 8 years ago

mauritsvanrees commented 8 years ago

First try our (t)rusty old way, as that reports the original line numbers.

Using lxml may lead to wrongly reported line numbers, as serializing means a tag always ends up on one line, where originally it may have been on multiple lines.

Fixes issue #34.

mauritsvanrees commented 8 years ago

@vincentfretin Can you have a look at this one. I think it is the best we can do.

vincentfretin commented 8 years ago

That's ok but I now have errors from Products.CMFPlone/Products/CMFPlone/skins/plone_templates/test_rendering.pt twice. I guess the first batch come from the old parser and the second batch from lxml parser. Same with plone.app.content/plone/app/content/browser/templates/content_status_history.pt and 3-4 other files.

mauritsvanrees commented 8 years ago

The last two commits should fix that.

vincentfretin commented 8 years ago

Indeed, this is fixed. But now I have extra blank lines in the output. :)

mauritsvanrees commented 8 years ago

I don't see this. But I guess I see how it can happen. Does the previous commit help?

vincentfretin commented 8 years ago

It helps. There is only one extra line now.

vincentfretin commented 8 years ago

There is 1 blank line between error of the same file and 2 blank lines between errors of different files.

mauritsvanrees commented 8 years ago

Ah, right. Previous commit ought to fix this.

vincentfretin commented 8 years ago

Now a new line is missing :)

vincentfretin commented 8 years ago

My previous commit fixes it. You can merge.

vincentfretin commented 8 years ago

Btw, maybe using Chameleon #21 would have solved this issue? I don't know. lingua may not have this issue, I didn't test it.

mauritsvanrees commented 8 years ago

As far as I see, lingua does not have a command to find untranslated string.

Thanks for the final fix. I have squashed the commits and kept only two for clarity. I'll merge. And then I'd say it is time for a release!

gforcada commented 8 years ago

:+1: great job guys!