Forum > Translations
Translate .lfm file in a lazarus package
tprud:
Hello,
I've made a Lazarus package with Forms and Frames. I've enabled i18n in my project and in my package option, and I've checked the 'Create/update .po file when saving a lfm file' both on my project and my package. I've selected the output folder.
But when I do some modifications, either on my project or my package, my project creates its own pot file for frames, forms and resource strings, but my package creates its own pot file only for resource strings. I've spent some time reading the forum and looking into Lazarus options, but I cannot resolve this issue.
The only options that cames in my mind are:
- Create a script to generate pot files from lrj files generated by lazarus for my package
- Use resource strings in forms and frames instead of using the properties of components from the IDE
Is there a solution to generate pot file for frames and forms of a lazarus package? Did I miss something?
I'm using Lazarus 4.5 with freepascal 3.2.2, installed using fpcupdeluxe. I'm working on Windows.
wp:
--- Quote from: tprud on April 17, 2026, 10:24:40 am ---Is there a solution to generate pot file for frames and forms of a lazarus package? Did I miss something?
--- End quote ---
Packages have their own i18n settings: "Package Options" > "i18n" > Check "Enable i18n", and, if you want form and frame strings to be in the po(t) files as well, check also "Create/update .po file when saving a lfm file" (in Laz release versions) or "Extract translatable strings from a form when saving its LFM file" (in Laz/main).
In your application, you must copy the po files of the packages into the languages files of the application so that the package strings can be translated. A famous example are the lclstrconsts.*.po containing the translated strings of the LCL package.
tprud:
--- Quote from: wp on April 17, 2026, 12:08:39 pm ---
--- Quote from: tprud on April 17, 2026, 10:24:40 am ---Is there a solution to generate pot file for frames and forms of a lazarus package? Did I miss something?
--- End quote ---
Packages have their own i18n settings: "Package Options" > "i18n" > Check "Enable i18n", and, if you want form and frame strings to be in the po(t) files as well, check also "Create/update .po file when saving a lfm file" (in Laz release versions) or "Extract translatable strings from a form when saving its LFM file" (in Laz/main).
--- End quote ---
As I said in my first message, I've already checked the i18n both on the project and the package. The "Create/update .po file when saving a lfm file" is checked as well both on the project and the package.
jcmontherock:
For your project, not for the package, each unit, which needs translation, should be included in the project inspector. Mentioned in uses clause is not enough.
wp:
--- Quote from: tprud on April 17, 2026, 12:24:06 pm ---As I said in my first message, I've already checked the i18n both on the project and the package. The "Create/update .po file when saving a lfm file" is checked as well both on the project and the package.
--- End quote ---
Sorry, I should read more carefully... Yes, I can confirm your observation.
Navigation
[0] Message Index
[#] Next page