Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Delphi's built-in multilingual support?

I use Delphi since version 2 and now on the version XE3.

Since BSD2006 I've noticed this menu Languages on the Project main menu. Now that I am interested in build an application available in English, Portuguese and Spanish, I searched for tutorials on the Internet but couldn't find anything about this function, only third party components and wizards. Since English is not my first language, I don't even know how to look for the right terms in order to get to this Delphi tool.

Does anyone already used this tool? Where Can I find a proper tutorial to get started? Thanks.

enter image description here

Edit1: Response

Since Remy answered correctly, but with a link, I will resume it so other can get to it quickly:

  1. Save all your project files
  2. Go to Menu > Project > Languages > Add
  3. Add as many languages as you need
  4. Go to Menu > View > Project Manager
  5. You will see your project plus a project for each language you created
  6. Expand one language project and you will see the DFM files to translate your forms
  7. Right click and open one and you will see the Translation Editor
  8. Translate all the needed strings and then save the file
  9. Again in the Project manager expand .\Win32\Debug\ and see the RC resource files
  10. Right click one and edit the constant strings of all the units files of your app

More Tips:

  • In order to get the strings of your own units into the translation list file, you have to create them as constants, but using not the consts reserved word, but the resourcestring one, like: resourcestring Str1 = 'Test'; StrN = '%s strings found';

  • Every time you create a new resourcestring or add a visual component on a form, you have to update the languages metadata, and to do it, go to Menu > Project > Languages > Update Localized Projects

  • Every time you finish to translate the terms on your language files, you not just have to save those files, but you have to re-build the projects they belong. It's easier if you go to Menu > Project > Build All Projects

These tips are not explained in the Embarcadero Help. Thanks Remy!

like image 333
NaN Avatar asked Jul 30 '13 18:07

NaN


People also ask

How can I activate multi language?

Go to Settings > Company Settings > Languages and toggle the switch to enable multiple languages.

How do I add multi language to my website?

Google Translate is a no-cost service provided by Google. It is by far the easiest and more common way to add multiple language support to your website. To add Google Translate to your site, you simply sign up for an account and then paste a small bit of code to the HTML.


1 Answers

Start by reading the documentation:

Localizing Applications by Using Translation Manager

Adding Languages to a Project

like image 154
Remy Lebeau Avatar answered Oct 26 '22 05:10

Remy Lebeau