Solved

Multilange

Posted on 2004-04-21
3
230 Views
Last Modified: 2010-04-05
Hi all,

I want to make a multi language app where the user can easily make changes in a text file.
The app then reads the file at startup and replaces label captions and so on.
Any suggestions?

Svenj
0
Comment
Question by:svenj
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 500 total points
ID: 10877160

   just a quick idea

   TEntityForm = class(TForm)
   ...
   private
      procedure GetLocales;
   public
   end;

   procedure TEntityForm.GetLocales;
   var
     counter : Integer;
   begin
     // read from sowhere the localized values - Database ot local file
     for counter := 0 to Self.ComponentCount - 1 do
        begin
           if Self.Components[counter] is TLabel then
              (Self.Components[counter] as TLabel).Caption := 'localized value';
           if Self.Components[counter] is TEdit then
              (Self.Components[counter] as TEdit).Text := 'localized value';
        end;
   end;


  Your localization file should look like this

  FormName  Component          Value
------------------------------------------------
  Form1         Label1                 Text
  Form1         Edit1                   TestEdit

  when you load Form1 - you read the values for Form1 only.

0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10877167

  the localization file can be in INI format

  [Form1]
  Label1=Text
  Edit1=TestEdit

  ....
0
 

Expert Comment

by:Sneaky_Pie
ID: 10966717
If you are looking for complete tool, try GNU Gettext for Delphi:
https://sourceforge.net/projects/dxgettext/

It's an open source project with mpl 1.1 license. I'm using it in several projects without any problems. The format of the translation files is po, thats a text format.
And, as an advantage, you can translate your application in a lot of languages. There are several delphi translations available.

Sneaky Pie
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
Print Graphic and Text to Epson TM-T88v 12 247
how to update exe applicatio from internet ? 6 76
DBCtrlGrid, Delphi, Scroll 8 10
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question