![]() ![]() If you compile the project again, you'll find two changes in the project folder: At first there is a new file with the extension. po file when saving a lfm file checked - this updates the translation "master" file whenever you save - see below. Be sure to keep this structure if you should later copy the exe to somewhere else. Note that this folder is relative to the folder containing the exe file. As you will see later, the translation files will have the extension. This is the folder where the files with translated texts will be stored. Enter the name for the PO Output Directory (use locale or languages as directory, so later it would be found automatically). This activates the i18n Options underneath. Put a checkmark in the checkbox Enable i18n. Strange word, isn't it? It is the abbreviation for "internationalization" and stands for "18 letters between the i and the n". ![]() It is found in the project options as item "i18n". ![]() Only one modification of the project is required to enable translation. Alternatively, single-line labels could be placed above the controls. One option would be to allow multi-line labels by setting their WordWrap property to true (and AutoSize to false). In this case, precautions have to be taken to avoid that they extend into the control if they become too long. ![]() Labels are often positioned to the left of the controls they belong to. In order to prevent components from overlapping, anchoring shall be used. Constraints.MinWidth set to a significantly high value. If several vertically positioned buttons are used and they are expected to equal width, besides Autosize= True they shall have. This means that if only single-line string components are used, they shall fit properly in a 700圆00 form, so when the form is enlarged to 1024圆00 it shall be sufficient for other languages. #LAZARUS MULTIPLE LFM TO ONE PAS PC#For a PC if a form is not scrollable, it shall not be greater that 1024圆00 pixels (10" netbook display). The GUI dimensions must consider the display of the device on which the application will be run. It is normal to expect that in some languages strings might be some 50% longer, but even 200% is not much unusual. That is why all components must have the Autosize property set to True. Let's convert this application to support translation into German.ĭuring design of the GUI it shall be considered, that a string will have a different length in each language. You'll see a typical application with a menu and some controls to show a file list and the selected image. Open the project file imgview.lpi, compile and run it. In order to keep the original, copy the entire project folder into a separate directory, e.g. Looking through the example projects that come with Lazarus I found that examples\imgviewer may be a decent demo project. There will be some notes here and here to identify the differences between the versions.Īt first, we need an application that we want to translate. Therefore I'd urge you to read the wiki articles Localization and/or Translations_/_i18n_/_localizations_for_programs which explain the basic fundamentals behind the scene.īefore starting, I'd like to mention that this tutorial was initially written for Lazarus version 1.2 and now has been updated to version 1.4. But it may be a good idea to learn something about the basic ideas behind that architecture. I'd like to share this information with interested users of Lazarus. Then I found out that is is amazingly simple once I understood the first steps. Preparing applications for several languages has always been a bit of a mystery to me - until I finally tried.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |