Solved

Multilange

Posted on 2004-04-21
3
223 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now