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 Page:    1  2  Next Page Last Page  
New Topic Reply Printer Friendly
A few questions - 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: Thu May 10th, 2007 08:30 pm
PM Private Upload Quote Reply
pipoman
Member
 

Joined: Thu May 10th, 2007
Location: Paris, France
Posts: 11
Status: 
Offline
Hello,

I am trying to understand the magic behind "Multilingual file" (in Delphi Source options) but I am kind of stuck. The help file was not of such great help and I could not see anything in the forum either. My question is quite simple: What does it really do behind the screen (new resource section of some sort?) and more important, what do I have to do to "activate" the translations at runtime?

I have also tried the "Resource DLL files" approach, and I also have a couple of questions related to that. When changing the language at runtime with SetNewResourceFile for instance, the form gets reloaded entirely from the corresponding DLL resource file (I believe that it's roughly how ITE works, which you reuse nicely). It works very well with simple forms but I have experienced problems with database frontend (client dataset opened and DevExpress grid) such as "Error reading XXX: Cannot perform this operation on an open dataset". Are there some considerations to have in mind (restart of the application for instance and architecture of the application)? Is it really necessary to reload the form entirely? Could it be possible to "simply" update all translated properties by let's say loading the translated form as a dummy and apply changes to the "real form" (that would work a bit like dxgetext, SiComponents or Korzh) (yeah I know, sounds easy)?

Nevertheless, I am truly amazed by what you have done guys. I am currently investigating the market for localization solutions, and you are clearly on the top of my list.

Back To Top PM Private Upload Quote Reply

 Posted: Fri May 11th, 2007 09:19 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Hi,

You are right. The documentation is missing. I have been writing documentation and few samples. I will reply better when I get the documentation written and samples tested (tonight or tomorrow).

Best regards,
Jaakko



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

 Posted: Fri May 11th, 2007 01:27 pm
PM Private Upload Quote Reply
pipoman
Member
 

Joined: Thu May 10th, 2007
Location: Paris, France
Posts: 11
Status: 
Offline
Thanks for your answer. Looking forward to the update of the documentation and for new examples presenting the "Multiligual file" approach. I just want to determine what is the optimal solution for my applications...

Could you please also have a look to the rest of my post? I just need to know if it would be possible someday to have Sisulizer working by "simply" modifying all localized properties without reloading the forms (just like gnugettext or SiComponents do for instance). I suspect that it is a tricky one, but it would be very nice because:
  • The current approach which reloads the forms when the user changes the language at runtime seems to fail in certain circumstances (form with an opened dataset for example). As far as I can see, this is not due to Sisulizer but mainly due to the form streaming mechanism in Delphi.
  • I would be really cool if Sisulizer could update localized properties on all instanciated forms according to the content of the chosen resource DLLs by making a sort of diiference between the current properties of the form (and its components) and the localized properties defined in the resource DLLs. It would then update all instanciated forms accordingly. I hope you get the picture ;)
A last thing: Do you have plans to extend mapping the DevExpress components (would be nice to enhance the way they are rendered) and map Toolbar2000 "natively"?

That's all for me. Thanks for listening :D

Back To Top PM Private Upload Quote Reply

 Posted: Tue May 15th, 2007 09:09 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Sorry about this delay. I found one bug I am fixng it. I will post reply tonight.

Jaakko



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

 Posted: Tue May 15th, 2007 09:29 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Multilingual file

First of all. I found a bug here. Sisulizer left the original neutral resources in the multilingual file and that make Windows always using the original resources and no the localized one. The bug has been fixed in 1.5.5 that will come out in few days.

Here is clip from new help topic.

Multilingual application and library files
A .exe or .dll has a possibility to store same resource item in several different languages. For example a .exe can contain the same dialog resource in English, German and French. This feature makes it possible to create a multilingual .exe.

Let's look at typical Windows application. Our example is a Delphi compiled applications. It has several resource types such as strings, forms, icons. The original language of the sample is English but Delphi compiler does not give resources English language id but give neutral id instead. A neutral language id is 0. The sample contains one form (TFORM1) that has neutral language id.

(picture)

When Sisulizer creates a multilingual .exe it adds each resource in several languages. Our example has three target languages: Finnish, German and Japanese. It also gives the original neutral resource language id matching the original language of the application (e.g. English). When we look at the resources of the multilingual .exe we find out that instead of one TFORM1 we have four TFORM1s. One in each language.

(picture)

The above application contains TFORM1 resource in German (7), English (9), Finnish (11) and Japanese (17).

Advantages
The clear advantage of multilingual .exe is that you can deploy the same file everywhere. There is no need to choose between different .exe or resource DLLs. This makes setup and deployment much easier.

Disadvantages
The biggest problem of multilingual .exe is that the developer or the end user has no easy control to configure what language resource to use. Windows operating system makes the choice. Unfortunately there is not single method how operating system makes this choice. The method depends on the operating system. In Windows 2000 and later the language is always the same as the language of the operating system itself. In Windows NT the language matching the International settings in the Control Panel will be used. 95/98/ME works like 2000 and later.

Because multilingual .exe contains the same resource in many times the size of the .exe can be much higher compared to the single language .exe. However on most cases the size of the resource blocks in the .exe is much smaller than the size of the code blocks. This means that even having a dozen languages in the same .exe won't double the size of the .exe.

Original resources
When Sisulizer creates multilingual application of library file it can ether keep the original resource files, modify them, or completely remove them. The action depends on the type of the source file and the settings of the source. PE files created by Delphi or C++Builder (later VCL-PE) has neutral language id in their resources. PE files create by Visual Studio or Visual Basic (later MS-PE) has a language id in ther resources.

To change the setting if to keep or remove existing resources right click the source name on the project tree and choose Properties. Then either check or uncheck Keep original resources check box.

(picture)

If you choose to keep the original resources (default), and you are localizing a VCL-PE file, and Sisulizer is about to add a localized resource item it will give a language if for the original neutral resource item. The language id will be the id of the original language of the source that is specified in the Encodings sheet of the above dialog. If the project contains a target language having the same language id than the original language, Sisulizer removes the original resource item even if Keep orignal resources is checked. The reason Sisulizer changes the language id of the original resource id is because if there would exist resource item with neutral language id and same resources with language id, Windows would always us the neutral resources no matter even if there were a resource having a matching language id.

If you choose not to keep the original resources Sisulizer will delete the original resource item if it adds a localized one.



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

 Posted: Tue May 15th, 2007 09:31 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Resource DLLs

VCL's resource DLLs
VCL has a build in feature using resource DLLs. When a VCL applications starts VCL is looking for a possible resource DLL from the same directory where the original file is located. If VCL can find this it uses resources of the resource DLL instead of the original PE file.

How to create resource DLLs
To make Sisulizer to create localized resource DLLs for your VCL files right click the source name on the project tree and choose Properties. Check Resource DLL files check box.

(picture)

By default Sisulizer adds all resources to the resource DLLs; even those that has not been localized. If you want to make you resource DLLs smaller uncheck Copy all resources. This will make Sisulizer to add only those resource items that has been localized.

Initial language
The method how VCL chooses the initial resource DLL is:
  1. First VCL looks from system registry under HKEY_CURRENT_USERSoftwareBorlandLocales a string entry whose name matches the full path name of the application or library. If VCL finds such an entry it load a resource DLL matching data of the entry.
    (picture)
    If our application is D:SrcDelphiSimpleProject1.exe, then VCL finds that FI extension should be use. It is going to look for D:SrcDelphiSimpleProject1.FI file (this file is a resource DLL even then file extension is not DLL). If resource DLL is found then VCL uses resource from that file.

  2. If no entry is found from the registry or the file matching the entry value does not exist then VCL is going to look for file matching the default locale of the user. This setting is specified in Regional and Language Options in Control Panel. 
    (picture)

    If the user default locale is Finnish (Finland) VCL is going to look for Project1.FIN.


  3. If that is not found then VCL look for country neutral resource (e.g. Finnish) in our case. if Project1.FI is found VCL uses that.
  4. If VCL can not found any of above resource DLLs it will use the original resources in the application or library file. In our sample VCL will use resources of Project1.EXE.
Language change
Sisulizer contains functions that let you change the language of VCL application on run time. <sldir>VCL contains the Delphi units. LaResource.pas and LaDialog.pas are the main units. LaResource.pas contains the functions for change the language and LaDialog.pas contains a dialog that shows possible resource DLL language. User can select the one he or she likes to turn on. Use LaDialog.SelectResourceLocale to show a language dialog and turn on the new language. The functions show a dialog where the user can select the language and after selection it turns on the new language by loading the new resource DLL and reloading existing forms.

Form reloading requires more explanation. LaResource.SetNewResourceFile function (that also SelectResourceLocale calls) performs the resource loading. After loading the new resource function calls ReinitializeForms function that reload the form data from resources. It is very important to understand what happens here. Sisulizer load the localized form data from localized resource DLL. This means that all the component ans properties that exist in the localized form data will be assigned to the current form. However if you changed any property value from code for example in OnCreate or OnShow events, the property valus do not change. If these so called dynamic property values need to be localized you have to set them again after language change. Let's have an example.

<sldir>VCLDelphiWinResourceDll contains a simple application using resource DLLs. FormCreate and FormShow events both either set property value of use data that is locale depent. FormCreate updates the caption of the main form.
procedure TForm1.FormCreate(Sender: TObject);
begin
  Caption := SLoading;
end;

FormShow sets the document URL using a resource string.
procedure TForm1.FormShow(Sender: TObject);
begin
  WebBrowser1.Navigate('http://' + SUrl);
end;

WebBrowser1DocumentComplete that is called after document is loaded sets the caption againm clears and sets the panel and finally enabled the language menu.
procedure TForm1.WebBrowser1DocumentComplete(
  ASender: TObject;
  const pDisp: IDispatch;
  var URL: OleVariant);
begin
  Caption := Format(SCaption, [SUrl]);
  StatusBar1.Panels.Clear;
  StatusBar1.Panels.Add.Text := Caption;
  Language1.Enabled := True;
end;

When application has loaded the document its state (= values of properties) is not the same as in desing time. The desing time state is the state that exist in the DFM file (e.g. form data). The caption of the main form, document URL, panel structure and language menu state have been changed on run time. When a language change occurs Sisulizer automatically updates the static properties (e.g those that exist on the form data) but does not change these dynamic properties. This is why you have to set them again. The following code changes the language and reinits the dynamic properties.
procedure TForm1.Language1Click(Sender: TObject);
begin
  if SelectResourceLocale(LANG_ENGLISH) then
  begin
    FormCreate(Self);
    FormShow(Self);
  end;
end;

SelectResourceLocale changes the language, FormCreate and FormShow resets the dynamic properties using the new language. There is no need to call WebBrowser1DocumentComplete because WebBrowser1 is calling it automatically after calling Navigate in FormShow.

Now our application works. After language change you have to remember to resets any dynamic properties. Thsi might seem a bit complicated but in most cases your language change routine in on the main menu or on the main form. In a situation like that you only have one form existing at that moment so you only have to take care if resetting dynamic properties of that form. All the other forms that you create after language chaneg will automatically use the new language.

Final note. Delpi IDE will add form creation code in the initialization section of the applciation for each form that you add to the project. You better keep only main form there and create all other forms yourself at the moment when tehy are first needed.
program Project1;
...
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

<sldir>VCL contains the full source code of all Sisulizer functions and several sample applications showing how to make localize and multilingual VCL applications.

Last edited on Tue May 15th, 2007 09:33 am by Jaakko.Salmenius



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

 Posted: Tue May 15th, 2007 09:34 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
These topics do not show that well on this forum. Please read if again from HTMLHelp of 1.5.5

Jaakko



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

 Posted: Tue May 15th, 2007 09:37 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
pipoman wrote: Could you please also have a look to the rest of my post? I just need to know if it would be possible someday to have Sisulizer working by "simply" modifying all localized properties without reloading the forms (just like gnugettext or SiComponents do for instance). I suspect that it is a tricky one, but it would be very nice because:
  • The current approach which reloads the forms when the user changes the language at runtime seems to fail in certain circumstances (form with an opened dataset for example). As far as I can see, this is not due to Sisulizer but mainly due to the form streaming mechanism in Delphi.
  • I would be really cool if Sisulizer could update localized properties on all instanciated forms according to the content of the chosen resource DLLs by making a sort of diiference between the current properties of the form (and its components) and the localized properties defined in the resource DLLs. It would then update all instanciated forms accordingly. I hope you get the picture ;)
A last thing: Do you have plans to extend mapping the DevExpress components (would be nice to enhance the way they are rendered) and map Toolbar2000 "natively"?

That's all for me. Thanks for listening :D
I spent a day testing this reload and totally agree you. The approach is a bit too heafy. I will implement feature that read the new property values from the resource file and updates the existing components without reload.

Jaakko

Last edited on Tue May 15th, 2007 09:37 am by Jaakko.Salmenius



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

 Posted: Tue May 15th, 2007 09:59 am
PM Private Upload Quote Reply
pipoman
Member
 

Joined: Thu May 10th, 2007
Location: Paris, France
Posts: 11
Status: 
Offline
I am truly impressed that you could implement this so fast!

I was just expressing an idea and was not expecting any implementation at that point. I am really looking forward to testing this change which should be very valuable for your product I think.

Great work indeed :dude:

Back To Top PM Private Upload Quote Reply

 Posted: Tue May 15th, 2007 10:10 am
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


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

thank you very much for your nice words.

We at Sisulizer are focused on making prospects and customers happy. If there is some feature needed by our users, and it makes sense in the context of our product, we are always willing to implement it. Of course our resources are limited - but we nevertheless work hard to do everything in a timely manner. We really want to give Sisulizer the best localization experience instead of repeating stupid marketing promises.

Three simple steps to localize - that is what we all really live for at Sisulizer. You, our valued users, help us with your input to the forum to get better every day: Thank you for that!

Best

Markus



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

 Posted: Tue May 15th, 2007 12:14 pm
PM Private Upload Quote Reply
pipoman
Member
 

Joined: Thu May 10th, 2007
Location: Paris, France
Posts: 11
Status: 
Offline
That is a very good attitude!

While we are talking about requests and wishes, I was also wondering 2 last things:
  • Have you any plan to support UPX-compressed exe files? It is of course always possible to uncompress the file before working on it in Sisulizer, but it would be really cool if this could be done directly (read transparently for the user). I do believe it could be valuable for your product as a whole, but you have to deal with the UPX APIs which I don't know anything about.
  • There are two widespread (I think) components which could be rendered in a nicer and more realistic way: Toolbar2k (TBItem are not rendered) and the famous QuantumGrid from Dev. Express (this one is probably very tricky because of its versatility). Do you think that the rendering could be improved?
That's all for now. Thanks.

Back To Top PM Private Upload Quote Reply

 Posted: Tue May 15th, 2007 12:22 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
There are two widespread (I think) components which could be rendered in a nicer and more realistic way: Toolbar2k (TBItem are not rendered) and the famous QuantumGrid from Dev. Express (this one is probably very tricky because of its versatility). Do you think that the rendering could be improved?That's all for now. Thanks.

Can please you send URL to Toolbar2k?

QuantumGrid is one of the most complex VCL component and it is very very flexible. Implementing that would be very hard. Anyway I take a look at it.

Jaakko

Last edited on Tue May 15th, 2007 12:22 pm by Jaakko.Salmenius



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

 Posted: Tue May 15th, 2007 12:29 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
pipoman wrote: Have you any plan to support UPX-compressed exe files? It is of course always possible to uncompress the file before working on it in Sisulizer, but it would be really cool if this could be done directly (read transparently for the user). I do believe it could be valuable for your product as a whole, but you have to deal with the UPX APIs which I don't know anything about.
Normally in this case we recommend to always use Sisulizer of unpacked and uncrypted EXE and then pack or crypt the EXE after Sisulizer has created the localized EXEs. Using SlMake command line you can make this all automatic in the make file.

Jaakko



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

 Posted: Tue May 15th, 2007 12:55 pm
PM Private Upload Quote Reply
pipoman
Member
 

Joined: Thu May 10th, 2007
Location: Paris, France
Posts: 11
Status: 
Offline
Thanks for your answers.

Toolbar2k (actually Toolbar2000) can be found at http://www.jrsoftware.org/tb2k.php. If I am the only one to make this request, then don't bother (it can always be mapped it to something else).

Regarding the QuantumGrid from DevExpress, I am aware that the component is extremely complex and versatile. That's why I was asking if some improvements are planned someday (it does not have to happen at once).

That's ashame with UPX, but I understand your reasons. If you ever change your mind, I would be glad :)

Back To Top PM Private Upload Quote Reply

 Posted: Tue May 15th, 2007 12:58 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
You are not the only customer that has asked about UPX. I have added that to new possible features list.

Jaakko



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

 Posted: Tue May 15th, 2007 01:09 pm
PM Private Upload Quote Reply
pipoman
Member
 

Joined: Thu May 10th, 2007
Location: Paris, France
Posts: 11
Status: 
Offline
Nice to hear.

Thank you very much for your help and your reactiveness guys :dude:

Back To Top PM Private Upload Quote Reply

 Posted: Tue May 15th, 2007 01:52 pm
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


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

>> That's ashame with UPX, but I understand your reasons. If you ever change your mind, I would be glad<<

we have to be careful with this.

According wikipedia (http://en.wikipedia.org/wiki/UPX) some authors use UPX to prevent reverse engineering. The part of the application Sisulizer reads for localization is meant to be read by third party. If a software author uses obfuscation to not allow that we have to respect that. While the software localizator in general is partnering with the software maker he should be able to get a program version open to be read by some localization tool.

Perhaps the other software developers joining the forum have some opinion on this. Do you think we should respect obfuscation or should we go for the technically possible? Please share your thoughts with us.

Best

Markus



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

 Posted: Mon May 21st, 2007 11:25 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator


Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Hi,

I have now completed TLaTranslator class. Starting from 1.5.5 the function LaResource.pas unit uses this translator. Form reloading is not used any more.

TLaTranslator class read the new resource data and updates all propery values on the existing froms and data modules.

This works much better than form realoading. There are no side effect such as changing of from state, flickering, form repositioning.

Basically the result is same as other VCL localization componenst (e.g. dxGetText and TsiLang) but with Sisulizer there is need to add only one line of code.

SelectResourceLocale('EN');

where the only parameter tells the original language of the application (e.g. EXE's resources).

Using embedded resources it is possible to make multilingual application having only one file (one EXE) and runtime language switch.

The new version will be available soon.

Thank you pointing this out.

Jaakko



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

 Posted: Tue May 22nd, 2007 06:57 am
PM Private Upload Quote Reply
pipoman
Member
 

Joined: Thu May 10th, 2007
Location: Paris, France
Posts: 11
Status: 
Offline
Sound really good. I just can't wait to give it a try....

Thanks a lot!

Back To Top PM Private Upload Quote Reply

 Posted: Thu May 24th, 2007 11:14 am
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


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

the new build 1.5.5 is online now :-) We hope the new classes work for you.

Best

Markus



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

Current time is 07:50 am 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) > Usage - Three simple steps to localize > A few questions



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