Closed unhammer closed 2 weeks ago
So apparently the tmx handling has this fancy feature for aligning translations even if there are numbers that might differ:
$ lt-print test.tmx.bin
0 1 f f 0.000000
1 2 o o 0.000000
2 3 o o 0.000000
3 4 0.000000
4 5 <n> @ 0.000000
5 6 ε ( 0.000000
6 7 ε 1 0.000000
7 8 ε ) 0.000000
8 0.000000
Maybe handy if you have big tmx files with things like "Stock market things went up by 999 % in Q5" and you want to use that even if they went up by just 234 %.
But it probably shouldn't copy the previous number – the alignment shouldn't look at stuff outside the matched segment. (And we may want to turn it off completely too?)
This:
fragment[i] = fragment[i].substr(0, j) + numbers[num - 1];
assumes all numbers are only those that have been matched by the fragment, but the processor also adds preceding numbers. The numbers vector is only cleared on a match, but should have been cleared before a match starts too.
why does it match numbers that are not 1, and why does it "copy" previously seen numbers? 😵💫