Resourcing hard coded strings in Delphi

Software localization tools like our Sisulizer localizes binaries, like executables (.exe) or library files (.dll). That has many advantages like

to name a few.
This works fine when your strings are stored in string tables of Windows resources. Luckily this is very easy in Delphi. Just use a resourcestring block instead of hard-coding the string.

Don’t use hard coded strings like

procedure TForm1.FormCreate(Sender: TObject);

begin

  Label2.Caption := 'Click the above button to process data'; 

end;

Use Delphi resourcestring blocks like

procedure TForm1.FormCreate(Sender: TObject);

resourcestring

  SClickButton = 'Click the above button to process data';

begin

  Label2.Caption := SClickButton;

end;

Use unique and descriptive names as resource strings. That gives you and your translator a much better idea of the context of the string, and a way better chance for a fast and good translation.

What if you have hard coded strings in 100k+ lines of Delphi code

What do you want to hear? Bad luck, internationalization tools are very expensive, chances a good that you have a lot of stupid work in front of you? I fear I have given too much people answers more of less like these. Shame on me.
First, you are not alone. And even better there is a great tool around that will help you through that job. And all this at a very competitive price.

Resourcing with CodeExplorer

CodeExplorer provides a whole set of ways to convert your hard coded strings to resources.

And it comes with various options for scanning, and converting, I.e. it helps you to identify strings that do not need to be localized at all, or do need special attention like SQL statements. It also provides warning mechanism for units.
CodeExplorer is made by our Dutch Embarcadero CodeGear Technology Partner fellow Modelmaker Tools. Prices start at EUR 99. Read more about resource string conversion with CodeExplorer on their web site.

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)


For spam filtering purposes, please copy the number 5313 to the field below: