Translation lookups always fail on Identifier lookups
Original Reporter info from Mantis: ggeldenhuys
-
Reporter name: Graeme Geldenhuys
Original Reporter info from Mantis: ggeldenhuys
- Reporter name: Graeme Geldenhuys
Description:
In the translations.pas unit Translate() method, the first attempt at looking up a translations is via the ResourceString Identifier. The Identifier constists of a unitname and resource constant name. eg: StrConst.rsOK
When using 'convrst' to generate .po files that identifier changes to 'strconst:rsok'. Note the '.' becomes ':'.
This is what causes the Translate() method to always fail it's first lookup via the ResourceString constants.
A attached two patches.
to_show_the_bug.diff ---> Shows the bug via DebugLn() output
To fix the bug, revert the previous patch and apply the following patch.
translations.diff ---> It does a string replace changing . to : as it's defined in the .po files.
Steps to reproduce:
- Apply the 'to_show_the_bug.diff' patch.
- Recompile LCL and IDE.
- Start Lazarus from the command line so you can see output to the console window.
- Changes the IDE language to German.
- Quit Lazarus and start it again from the command line.
- You should now see lots of output lines like the following... The lookup should in actual fact always pass using the Identifier lookup.
Translate failed on Identifier lookup.
Translate failed on Identifier lookup.
Translate failed on Identifier lookup.
Translate failed on Identifier lookup.
Translate failed on Identifier lookup.
Translate failed on Identifier lookup.
Translate failed on Identifier lookup.
Translate failed on Identifier & OriginalValue lookup.
Translate failed on Identifier lookup.
Mantis conversion info:
- Mantis ID: 10938
- OS: Ubuntu Linux
- OS Build: 7.04
- Build: v0.9.25 r14167M i386-linux-gtk
- Platform: x86
- Version: 0.9.25 (SVN)
- Target version: 0.9.26