Translations.TPOFile.Translate raises Exception while translating lclstrconsts.de.po
Original Reporter info from Mantis: ruewa
-
Reporter name:
Original Reporter info from Mantis: ruewa
- Reporter name:
Description:
I tried to implement the TranslateUnitResourceStrings function similar to http://wiki.lazarus.freepascal.org/Translations_/i18n/_localizations_for_programs#Compiling_po_files_into_the_executable
With lclstrconsts.de.po this fails in Translations.TPOFile.Translate (in Line 790). The reason is: lclstrconsts.de.po contains some empty translation strings (mostly IDE-related). So if the .po-file is not worked out 100%, the wiki-solution will fail.
So this might be either a problem of the .po file, which is not worked out completely, or one of Translations.TPOFile. I guess the desired behaviour would be to take the original (english) string in case of an empty translations string?
Steps to reproduce:
function TranslateUnitResourceStrings as documented in http://wiki.lazarus.freepascal.org/Translations_/i18n/_localizations_for_programs#Compiling_po_files_into_the_executable
The exception occurs while executing the line "POFile.ReadPOText(r.Value);"
Additional information:
My workaround was to edit the lclstrconsts.de.po file by filling all empty translation strings (msgstr) with copies of the original (english) message (msgid). After doing so the TranslateUnitResourceStrings function worked without any problems.