Kornel Benko wrote:

> So what is Uwe doing when he is re-merging? Probably calling
> development/tools/mergepo.py.

No. The workhose for remerging translations from the source code is 
po/lyx_pot.py. mergepo.py is only for merging between two branches without 
ptoducing huge nonsense diffs.

> I am not sure (because I am not expert) what
> happens on Windows. See mergepo_minimaldiff() there:
> 
> // What happens here with line endings?
> po2 = polib.pofile(source)
> 
> // This one looks good, but shouldn't we better explicitly open for
> text-mode? po1 = io.open(target, 'r', encoding='utf_8', newline=None)
> oldlines = read(po1)

lyx_pot.py opens some files explicitly with unix line ends, but not all:

output = io.open(output, 'w', encoding='utf_8', newline='\n')

I forgot all the details, but one reason for broken line ends that I do now 
remember again is this: Uwe is on windows, and receives an updated .po file 
from a translator who uses linux. Thus, the line ends are 'wrong' for his 
windows machine. I think this does not matter if he submits this as-is (git 
can cope with that), but if he remerges strings before submitting, then this 
might result in mixed line ends.

Maybe lyx_pot.py can be made more intelligent here? I am still strongly 
convinced that it is worth it to invest some time into a translations update 
machinery that is robust and does never require manual cleanup after a huge 
nonsense diff has been produced pays off in the long term.


Georg

Reply via email to