KapiX / Polyglot

Translation system for Haiku's catkeys, tailored for translating apps from different authors
https://i18n.kacperkasper.pl
MIT License
5 stars 1 forks source link

Polyglot doesn't detect some catkey key changes #51

Closed adamfowleruk closed 4 years ago

adamfowleruk commented 4 years ago

Had this problem with Paladin and had to write this tool to spot the issues:-

https://github.com/adamfowleruk/CatalogTester

If the key had trailing spaces, but this was removed, Polyglot doesn't detect the change and leaves the spaces in the key. This causes the generated catkeys file to fail on linkcatkeys.

Same issue if the key text remains the same except for a capitalisation change on one of the letters.

The en.txt in the above repo is exported from Paladin, the de.txt from polyglot is manually fixed using pointers from my tool (so it correctly identifies all issues), and the it.txt from polyglot is there to show one that fails the fingerprint check.

KapiX commented 4 years ago

If the key had trailing spaces, but this was removed, Polyglot doesn't detect the change and leaves the spaces in the key.

Perhaps ORM is trimming the parameters.

Same issue if the key text remains the same except for a capitalisation change on one of the letters.

Right, I have case-insensitive collation set on the database so of course STRCMP would ignore case. SQL is fun. :)

I will look more closely into this over next few days.

From README:

Non escaped newline (\n) and tab (\t) characters in keys

Do you mean there is an actual new line in the file?

adamfowleruk commented 4 years ago

No, all the newlines and tabs were escaped in my example. PulkoMandy suggested I look for unescaped ones, so that's where my investigation started.

I may alter my catkeys testing programme to do auto fixes for these things perhaps...

Thanks for taking a look! I know someone wants the Portuguese translation.

KapiX commented 4 years ago

Turns out ignoring trailing whitespace when comparing strings is another MySQL, and not ORM, feature.

I have addressed this issue by trying to detect case and whitespace changes, and instead of dropping these differing strings with their translations, they are just updated and translations marked as incomplete.

The fix is already deployed.

@humdingerb can you update relevant help pages with that info? :)

adamfowleruk commented 4 years ago

Great, thanks!