Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Resource string for Multilanguage User interface



Permlink Replies: 4 - Last Post: Jan 26, 2016 10:28 AM Last Post By: John Kouraklis Threads: [ Previous | Next ]
Clement Doss

Posts: 133
Registered: 9/19/00
Resource string for Multilanguage User interface
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 28, 2015 3:13 PM
Hi,

Using XE8/Seattle

My project group has several executables that shares a common library / classes / forms. Each project also have its library / classes / forms.

Today I'm maintaining manually a group of .RC files. Each have its namespace convention. For example:
core.culture.validation.pas ( will contain constants like _CORE_VALIDATION_FIELDREQUIRED = 1000 )
core.culture.validation.resouces.rc ( will contain several STRINGTABLEs with the apropriate language/sublanguage and a StringID with the corresponding text )
core.culture.message ( will contain _CORE_MESSAGE_FILENOTFOUND = 2000 )
core.culture.message.resources.rc ( will contain the corresponding STRINGTABLEs )

I'm splitting those units in logical groups ( validation, UI controls, messages, exceptions, etc ).
Each shared unit ( core.culture.validation, core.culture.messages, core.culture.UIcontrols, etc ) might have its application counter part (app.culture.validation, app.culture.messages, etc ).
All projects will share "core.culture.validation", but each project will have its "app.culture.validation".

The problem I have is with Resource String IDs. As the projects grow, eventually I'll have to deal with String ID conflicts.
And that's a mess I want to avoid.

Using ResourceString/ DRC file seems like the way to go. Looking at .DRC file, it has almost everything... except the language!
I hope I'm missing something and I can easily add LANG / SUBLANG to .DRC file and include it somehow in my EXEs.
I would like to have all the resources in the same EXE ( no extra DLL ).

1) How can I safelly modify .DRC ( or generate it correctly ) with the corresponding language ?

2) With the modified .DRC ( several languages will be created ), how can I compile it in my executable and be able to debug, test deploy the application

3) Is there a better way to solve this problem?

Best regards,
Clément

Clement Doss

Posts: 133
Registered: 9/19/00
Re: Resource string for Multilanguage User interface
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 2, 2015 8:00 AM   in response to: Clement Doss in response to: Clement Doss
Hi,

After looking around I decided to design my own Multilanguage solution.
Basically I'll create an application to insert the languages/translations I need.
The data will be store in XML format.
From this XML, the application will generate a RC (with all the languages) and a INC file with the constants.
This way it will be very simple to translate and I won't need to keep track of the constant values.
From my code I'll reference a global culture class that will access the required resources.

Clément
John Kouraklis

Posts: 209
Registered: 3/10/01
Re: Resource string for Multilanguage User interface
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 12:47 AM   in response to: Clement Doss in response to: Clement Doss
Clement Doss wrote:
Hi,

After looking around I decided to design my own Multilanguage solution.
Basically I'll create an application to insert the languages/translations I need.
The data will be store in XML format.
From this XML, the application will generate a RC (with all the languages) and a INC file with the constants.
This way it will be very simple to translate and I won't need to keep track of the constant values.
From my code I'll reference a global culture class that will access the required resources.

Clément

Hi Clement,

have you tried any of the tools available in the marker? I'm auditing a couple.

I am checking Sisuliser and Langman.

John

Clement Doss

Posts: 76
Registered: 3/26/00
Re: Resource string for Multilanguage User interface
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 3:03 AM   in response to: John Kouraklis in response to: John Kouraklis
Hi John


Hi Clement,

have you tried any of the tools available in the marker? I'm auditing a couple.

I am checking Sisuliser and Langman.


I tried several tools available in the market, but none of them did what I needed.
I wrote my own multilanguage resource editor. It generates a .pas with stringId constants and a .rc file with all the languages. It uses microsoft/google translator to translate. One weekend work, who need to rest anyway :-)?

Clément
John Kouraklis

Posts: 209
Registered: 3/10/01
Re: Resource string for Multilanguage User interface
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2016 10:28 AM   in response to: Clement Doss in response to: Clement Doss
Clement Doss wrote:
Hi John


Hi Clement,

have you tried any of the tools available in the marker? I'm auditing a couple.

I am checking Sisuliser and Langman.


I tried several tools available in the market, but none of them did what I needed.
I wrote my own multilanguage resource editor. It generates a .pas with stringId constants and a .rc file with all the languages. It uses microsoft/google translator to translate. One weekend work, who need to rest anyway :-)?

Clément

Yeah...not in the mood to rest :-)

I suppose it's not an open source project, right? I just thought to ask :-)

Your approach sounds like it can be cross-platform. I'll sit down and produce mine on these lines you suggest then.

Thanks

John
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02