Recent

Author Topic: lazarus "i18n" PO Output Directory setting, Users are easily misled  (Read 3656 times)

gasensor

  • Jr. Member
  • **
  • Posts: 78
User can set the PO Output Directory freely in lazarus. However, the PO Output Directory should be "languages","locale" or "locale/LangID/LC_MESSAGES". Otherwise the user program will not display correctly. It is not mentioned anywhere.

Maybe, it is a good idea that change it form TEdit to TRadioButton.


wp

  • Hero Member
  • *****
  • Posts: 12459
The directories are hard-coded in the LCLTranslator unit. But you can use the translation system also without LCLTranslator, and in this case you have full control over the location of the po files (https://wiki.lazarus.freepascal.org/Getting_translation_strings_right#ResourceStrings_in_your_Application).

dsiders

  • Hero Member
  • *****
  • Posts: 1282
User can set the PO Output Directory freely in lazarus. However, the PO Output Directory should be "languages","locale" or "locale/LangID/LC_MESSAGES". Otherwise the user program will not display correctly. It is not mentioned anywhere.

Maybe, it is a good idea that change it form TEdit to TRadioButton.

The requirement is documented in the LCLTranslator unit:

https://dsiders.gitlab.io/lazdocsnext/lcl/lcltranslator/index.html

But it is not mentioned in the Context Help used in the IDE dialog:

https://wiki.lazarus.freepascal.org/IDE_Window:__Project_Options#i18n

I am not sure who maintains that information on the wiki. Perhaps you could file a bug report for it.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

CCRDude

  • Hero Member
  • *****
  • Posts: 612
If you speak about the path, it would fit better into Compiler Options / Paths for me.
I've got a project with multiple build modes, with different target folders for the executables, and possibly different strings per mode (branding).
But then, it could not be easily updated when saving .lfm files...

The way it currently is works fine :)

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
As CCRDude said, the location set in Lazarus is more about where the files are stored during development and where the build system will look for them.

At run time is a different thing, its pre-determined in the Translator and complies with most operating systems defaults.

https://wiki.freepascal.org/Everything_else_about_translations#Where_a_Lazarus_App_looks_for_Language_Files is linked off the main i18n page, https://wiki.freepascal.org/Translations_/_i18n_/_localizations_for_programs

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018