Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: String Resource File, C++ Builder XE?


This question is answered.


Permlink Replies: 4 - Last Post: Sep 20, 2016 12:19 PM Last Post By: Remy Lebeau (Te...
Geoff Von Allmen

Posts: 6
Registered: 4/17/16
String Resource File, C++ Builder XE?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2016 9:50 AM
I've been able to properly run the Resource DLL Wizard and generate all of the files necessary to localize all the forms of an application I'm working on.

Where I'm running into issues is trying to localize strings that are present in the .cpp files. I've been reading that I need to create a Delphi package and place all the strings that are to be translated into that file as 'stringresource' objects. However, all the instructions on how to do this state I need to create a new Delphi Package ( [Embarcadero Example|http://docwiki.embarcadero.com/CodeExamples/Seattle/en/ResourceString_(C%2B%2B)]). I'm using C++ Builder XE and it would seem that is not an option.

I've also looked at using the Boost/local xgettext tools for this, but it looks like that library isn't available until 1.55 (the version that came with XE is 1.39). All the documentation seems to assume you're using newer versions of RAD but ... this is what we've got.

I'm happy to use the resource string method if someone could point to how that may work in this particular scenario? Also - I really know nothing about Delphi so, maybe I'm just missing something in the steps...?

Thanks!
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: String Resource File, C++ Builder XE?
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2016 10:48 AM   in response to: Geoff Von Allmen in response to: Geoff Von Allmen
Geoff wrote:

I've been reading that I need to create a Delphi package and place
all the strings that are to be translated into that file as 'stringresource'
objects. However, all the instructions on how to do this state I need
to create a new Delphi Package ( [Embarcadero Example|http://docwiki.embarcadero.com/CodeExamples/Seattle/en/ResourceString_(C%2B%2B)]).
I'm using C++ Builder XE and it would seem that is not an option.

You can create a Package in C++Builder. It would simply be a .bpk project
instead of a .dpk project. You can add Delphi .pas files to a C++Builder
project.

--
Remy Lebeau (TeamB)
Geoff Von Allmen

Posts: 6
Registered: 4/17/16
Re: String Resource File, C++ Builder XE?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2016 11:51 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Geoff wrote:

I've been reading that I need to create a Delphi package and place
all the strings that are to be translated into that file as 'stringresource'
objects. However, all the instructions on how to do this state I need
to create a new Delphi Package ( [Embarcadero Example|http://docwiki.embarcadero.com/CodeExamples/Seattle/en/ResourceString_(C%2B%2B)]).
I'm using C++ Builder XE and it would seem that is not an option.

You can create a Package in C++Builder. It would simply be a .bpk project
instead of a .dpk project. You can add Delphi .pas files to a C++Builder
project.

--
Remy Lebeau (TeamB)

Thanks Remy.

I'm able to create the project and then add a unit, which I rename to StringResources.pas. I then populate it with the following:

unit DelphiUnit;

interface

resourcestring
Message = 'This is a Delphi resource string.';

implementation

end.


But when I try and build the package I get Declaration Syntax errors -- from the list shown it doesn't look like it wants to build a delphi package as it is pretty much showing an error on every line.

Thanks -

Geoff V.
Geoff Von Allmen

Posts: 6
Registered: 4/17/16
Re: String Resource File, C++ Builder XE?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2016 12:11 PM   in response to: Geoff Von Allmen in response to: Geoff Von Allmen
Geoff Von Allmen wrote:
Remy Lebeau (TeamB) wrote:
Geoff wrote:

I've been reading that I need to create a Delphi package and place
all the strings that are to be translated into that file as 'stringresource'
objects. However, all the instructions on how to do this state I need
to create a new Delphi Package ( [Embarcadero Example|http://docwiki.embarcadero.com/CodeExamples/Seattle/en/ResourceString_(C%2B%2B)]).
I'm using C++ Builder XE and it would seem that is not an option.

You can create a Package in C++Builder. It would simply be a .bpk project
instead of a .dpk project. You can add Delphi .pas files to a C++Builder
project.

--
Remy Lebeau (TeamB)

Thanks Remy.

I'm able to create the project and then add a unit, which I rename to StringResources.pas. I then populate it with the following:

unit DelphiUnit;

interface

resourcestring
Message = 'This is a Delphi resource string.';

implementation

end.


But when I try and build the package I get Declaration Syntax errors -- from the list shown it doesn't look like it wants to build a delphi package as it is pretty much showing an error on every line.

Thanks -

Geoff V.

Ok - I was able to get that to compile (I just re-added it in the project ... I'm not sure why it wasn't compiling before...).

Thanks for the help -

Edited by: Geoff Von Allmen on Sep 20, 2016 12:19 PM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: String Resource File, C++ Builder XE?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2016 12:12 PM   in response to: Geoff Von Allmen in response to: Geoff Von Allmen
Geoff wrote:

I'm able to create the project and then add a unit, which I rename
to StringResources.pas. I then populate it with the following:
<snip>
But when I try and build the package I get Declaration Syntax errors

Works fine for me, using the exact code you have shown.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02