Support forum of the software localization tool Sisulizer


.NET, Delphi, ... - Sisulizer Localization Tool Support Home

Get in contact with the makers of Sisulizer.
Our forum is open for all questions around Sisulizer from customers and prospects.
Don't hesitate to register and ask. The Sisulizer team will answer ASAP.

Search     Help Home Sisulizer Website Download
Search by username
Not logged in - Login | Register 

 Moderated by: Sisusupport, Renate.Reinartz, Markus.Kreisel, Ilkka.Salmenius Page:    1  2  Next Page Last Page  
New Topic Reply Printer Friendly
Translate a resource file with C code - Bugs and Quirks in Sisulizer - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support
AuthorPost
 Posted: Thu Sep 21st, 2006 09:38 am
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
I have got a multi project (Borland c++ builder 5.1) with DLL in C code, and I must translate strings, who are in rc file.

I try to translate it with LoadString(...) without any changement on display.

Can I use a C funstion than LoadStr() to translate RC resource???

Project Sisulizer : "Embedded resource DLL files"

Sisulizer 1.0.181

Attachment: Sisulizer Traduction.zip (Downloaded 2 times)

Last edited on Thu Sep 21st, 2006 09:42 am by Benjamin

Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 09:50 am
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
I try to send you directly my request, but you e-mail address doesn't work!!!!!!!

Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 09:53 am
PM Private Upload Quote Reply
Sisusupport
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2261
Status: 
Offline
LoadStr is a VCL function that reads the resource from the active resource. By default this is the resource data of EXE file that you are running. However if you have loaded resource DLL LoadStr will get the resource from there first and if fails then from EXE.

If you have plain C code you do not use VCL and you can not use LoadStr but you have to use WIN32's LoadString functions.

Best regards,

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 09:59 am
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
Show my project example.
I do that but nothing.

Last edited on Thu Sep 21st, 2006 09:59 am by Benjamin

Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 10:01 am
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 3246
Status: 
Offline
Hi Benjamin,

we get a lot of mails incl. spam on our mail accounts wihout problems. Can you please post me the error message you get, so I can check what happens to your mail?

Best

Markus Kreisel
http://www.sisulizer.com



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 10:43 am
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 3246
Status: 
Offline
Hi Benjamin,

have you tried to use this tip from Jaakko posted earlier in the forum?

-------------------------

If you have a localized resource DLL you have to do the following steps:

1) Load the resource DLL into memory using LoadLibrary. This function will return a resource hadle.

handle = LoadLibrary("MyApp.DEU");

Loads German resource DLL

2) For each string you call LoadString and you pass the resource handle and the string id. The function returns the string.

LoadString(handle, 100, buffer, bufferLen);

Reads the resource string having id 100 from tge MyApp.DEU resource DLL.

We do not have any plain C samples to use resource string but the procedure is very simple. Just follow the step I decribed above.

------------------------------------------

Best

Markus



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 11:34 am
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
Markus,

LoadLibrary(..) is a function using for opening "executable module" and I have to open resource file.

When you execute my small example, it works?

Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 11:49 am
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 3246
Status: 
Offline
Hi,

your resources have to be part of a DLL file - and this is an executable module which of course can be loaded by loadmodule.

Best

Markus
http://www.sisulizer.com



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 12:52 pm
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
Can you execute my sample application below.

Because I don't know what you want that I must do.

   char sTemp[400];

   Label1->Caption = DI_Translate(DI_Label, sTemp, 400);
   Edit1->Text = DI_Translate(DI_Edit, sTemp, 400);
   Button1->Caption = DI_Translate(DI_Bouton, sTemp, 400);



resource file

     #include "dico.h"

     #ifdef RC_INVOKED

    STRINGTABLE
    {
       DI_Label       "RApplication"
       DI_Edit        "CVIPC"
       DI_Bouton      "Langue"
    }

    #endif

dico.h file

    #ifndef DicoH
    #define DicoH

    #define DI_Label        1
    #define DI_Edit         2
    #define DI_Bouton       3

    #endif

and I use Sisulizer to change the RC String

I think that my small project can be build in C++ builder 6 and 2006.

Can you try?

Attachment: Sisulizer Traduction.zip (Downloaded 0 times)

Last edited on Thu Sep 21st, 2006 12:53 pm by Benjamin

Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 01:06 pm
PM Private Upload Quote Reply
Sisusupport
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2261
Status: 
Offline
I can not run it because it requires VCL50.bpl that I do not have.

I looked you source code and fidn that you use LoadString correctly. However the first parameter (resource intance) in NULL and it means that it always uses the resources of the EXE.

C++Builder 6 and 2006 has LoadStr function that uses the currently active resource (either resource in the EXE or resource in the resource DLL if any).

It might be that it would work on C++Builder 5 but because I have not managed to get that old version I can not check it.

I still don't quite understand what it is that you try to get. It is this:

- You want to have one single EXE that supports multiple language.

This can not be arvived by making multilingual EXE because you do not have control what is the active language. You must use resource DLLs. here there are two choices:

1) Separate resource DLLs. One for each language. If you EXE is MySample.EXE the MySample.DE is German resource DLL and MySample.FR French one.

2) Embedd the resource DLLs (e.g MySample.DE and MySample.FR) to the EXE.
Currently we do not have a C++Builder sample for this (only Delphi) but I will create it and send it to you.

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 01:10 pm
PM Private Upload Quote Reply
Sisusupport
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2261
Status: 
Offline
One more.

Sisulizer can be use to change resource string (and any other resource as well). Sisulizer will create (depending on the setting):

1) One localized EXE for each language

2) One localized resource DLL for each language

3) One multilingual EXE that contains resource is all language of your project. However you can not control what is the language when application start.

4) As #2 but the resource DLLs are embedded as custom resources to the EXE file.
You have to call ExtractResourceFiles somewhere in your application initialization to extract the resource DLL from custom resources to external resource DLLs.

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 01:51 pm
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
I understand what you say.

I put this function to the constructor but I cannot find what is the TExtractOptions :

ExtractResourceFiles(TExtractOptions, "dico.rc");

???
enum TExtractOption { eoCheckDate, eoRemoveFiles };

typedef Set<TExtractOption, eoCheckDate, eoRemoveFiles>  TExtractOptions;


can you show me how call this function

Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 01:54 pm
PM Private Upload Quote Reply
Sisusupport
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2261
Status: 
Offline
I am writing a C++Builder sample. I will send it to you tomorrow.

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Thu Sep 21st, 2006 02:28 pm
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
Thanks a lot

Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 22nd, 2006 02:02 am
PM Private Upload Quote Reply
Sisusupport
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2261
Status: 
Offline
Hi Benjamin,

I uploaded 1.0.182. Download it and update your Sisulizer setup.

There was a bug in Sisulizer that make Sisulizer to write the embedded resource DLL using a lower case resource name. This made extraction of the resource DLLs to fail.

<sldir>\VCL\CBuilder\Embedded directory contains a C++Builder sample that uses embedded resource DLLs.

<sldir>\VCL\*.pas contains the new VCL source code. Read the comments to get more informtion about functions, types and parameters. The C++ header (*.hpp) do not contains any commants because they are automatically generated from the Delphi sources (*.pas)

I hope this will help you create a multilingual C++Builder application.

Best regards,

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 22nd, 2006 08:15 am
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
I cannot exacute your example can you send me the 2 DLL :

borlndmm.dll
cc3270mt.dll

Or modify this project Borland 2006 in Borland 6

Plz

Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 22nd, 2006 08:23 am
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
No it s good.

I have modif this project in borland 5 no problem

But, what about resource file and LoadString?

Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 22nd, 2006 08:54 am
PM Private Upload Quote Reply
Sisusupport
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2261
Status: 
Offline
Sorry. I had left runtime library as DLLs. This new sample is all statically linked.

I also added resource strings so you can see how to use them.

Jaakko

Attachment: Embedded.zip (Downloaded 3 times)



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 22nd, 2006 09:03 am
PM Private Upload Quote Reply
Benjamin
Member
 

Joined: Wed Aug 2nd, 2006
Location: Nantes, France
Posts: 33
Status: 
Offline
Can you send me all the argument of ExtractResourceFiles

ExtractResourceFiles(...);

plz


Attachment: ExtractResourceFile.JPG (Downloaded 25 times)

Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 22nd, 2006 09:08 am
PM Private Upload Quote Reply
Sisusupport
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2261
Status: 
Offline
Look <sldir>\VCL\LaResource.pas



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

Current time is 04:01 pm Page:    1  2  Next Page Last Page    
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > Translate a resource file with C code



WowUltra modified by Sisulizer Copyright © 2007-18 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Impress - Privacy statement

Sisulizer software localization tool - Three simple steps to localize