Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] Lazarus Pascal - Localization - Fix: Resourcestrings and/or units not included in POT file

1 Posts
1 Users
0 Reactions
243 Views
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter  

For those tinkering with localization, you may run into the issue I ran into: resourcestring of extra units would not appear in the POT files.

To generate POT files (template for PO files) you'll need a few initial steps:

1) In Project -> Project Options -> check Enable i18n and check Force update PO files in next build.

Set the location where the POT files needs to be save.

Tip for macOS users:
I always put my POT file in (manually make the "locale" directory after you had Lazarus create a project .app bundle).  
Lazarus trunk has been updated to work with that (alternative: call the directory "languages") - see Lazarus Pascal Bug Tracker.
Also, to determine the locale string (2 character language code) see my earlier post here.

project-directory/<projectname>.app/Contents/Resources/locale

2) Add the unit LCLTranslator to the uses clause of your main unit.

3) Make sure all units that need translating are listed in the Project Inspector.

If you forget that last step, then extra units will NOT be included in the POT file - took me literally days to figure this one out.

I'm posting this here since I took me quite some research and testing (hence the found bug) to get this to even work.
Hope someone benefits from this 😊 


   
ReplyQuote
Share: