Solved

Multilange

Posted on 2004-04-21
3
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month7 days, 15 hours left to enroll

617 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