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: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius
New Topic Reply Printer Friendly
How to localize bitmaps? - Usage - Three simple steps to localize - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support
AuthorPost
 Posted: Mon Aug 16th, 2010 10:40 am
PM Private Upload Quote Reply
heinze
Member
 

Joined: Wed Aug 4th, 2010
Location:  
Posts: 14
Status: 
Offline
Hello,

with some resource editor tool I created a .res file that contains two bitmaps. One of these bitmaps contains the german text "Hauptmenü", the other one contains the english translation "Main Menu". In the .res file, I gave both bitmaps the same resource name "HAUPTMENUE" and assigned different languages to them (see attachment). I also included the .res file into my delphi project (using the $R directive) and brought the resource into my resource dll with Sisulizer. (As German is the default language, I only have a resource dll for English, not for German.)

So when my application starts with german language, it should load the german bitmap resource, when it starts with english lanugage, it should load the english bitmap resource.

I tried to use the code of the <SISU-DIR>\VCL\Images example project but I always get an exception saying that the bitmap image is not valid. Probably the stream returns no data.

Here is the code that I use (NavBarVImage is a TImage):

  stream := TResourceStream.Create(GetResourceInstance, 'HAUPTMENUE', RT_BITMAP);
  //image := TBitmap.Create;
  try
    //image.LoadFromStream(stream);
    NavBarVImage.Picture.Bitmap.LoadFromStream(stream);
  finally
    //image.Free;
    stream.Free;
  end;


 

Attachment: Hauptmenue_res_screenshot.jpg (Downloaded 14 times)

Back To Top PM Private Upload Quote Reply

 Posted: Mon Aug 16th, 2010 11:04 am
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


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

Why don't you include bitmaps in your localization project? See Project - Edit Source - <your source> - Excluded Types. Make sure that Picture is not excluded. Now if you localize your DLL you can replace the image and Sisulizer creates you a localized resource. It works the same as with Strings.

Since your image consists just of a rotated text it might be even easier to create the image at runtime from a string using the GDI. If you later have to localize to other languages you don't need to create more and more images.

Hope this helps

Markus




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

 Posted: Mon Aug 16th, 2010 11:05 am
PM Private Upload Quote Reply
Jaakko.Nieminen
Administrator
 

Joined: Sat Mar 20th, 2010
Location:  
Posts: 657
Status: 
Offline
If you have the same source in two different languages it is unsafe to use TResourceStream.Create because it may pick either of the image. The class can not make difference between different language version but uses the resource that is first on the resource tree. It may be German or English.

I recommend you to add the image resource in one language only. If you original language is German add the German image. Then the translator translates the image into English.

Because you get an error message I belives the resource DLL does not contain the image resource. Check that it is really there.

Jaakko

Back To Top PM Private Upload Quote Reply

 Posted: Wed Sep 1st, 2010 03:49 pm
PM Private Upload Quote Reply
heinze
Member
 

Joined: Wed Aug 4th, 2010
Location:  
Posts: 14
Status: 
Offline
Markus.Kreisel wrote: Hi,

Why don't you include bitmaps in your localization project? See Project - Edit Source - <your source> - Excluded Types. Make sure that Picture is not excluded. Now if you localize your DLL you can replace the image and Sisulizer creates you a localized resource. It works the same as with Strings.

Since your image consists just of a rotated text it might be even easier to create the image at runtime from a string using the GDI. If you later have to localize to other languages you don't need to create more and more images.

Hope this helps

Markus




Hi Markus,

both of your tips were very useful! Thank you.

For my rotated text I changed my code so that the text is now written at runtime. Now the text is less smooth but that doesn't matter for me. :-)

Including bitmaps in the project is also a good idea because I have further bitmaps in my application that have to be localized.

Heinze

Back To Top PM Private Upload Quote Reply

Current time is 08:27 am  
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Usage - Three simple steps to localize > How to localize bitmaps?



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

Sisulizer software localization tool - Three simple steps to localize