|
|||
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius | Page: 1 2 |
|
|||||||||||||||
| 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 | |||||||||||||||||
| Author | Post | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||
|
pipoman Member
|
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.
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
pipoman Member
|
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:
That's all for me. Thanks for listening :D
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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:
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.
FormShow sets the document URL using a resource string.
WebBrowser1DocumentComplete that is called after document is loaded sets the caption againm clears and sets the panel and finally enabled the language menu.
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.
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.
<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 |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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: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 |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
pipoman Member
|
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:
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Markus.Kreisel Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
pipoman Member
|
That is a very good attitude! While we are talking about requests and wishes, I was also wondering 2 last things:
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
pipoman Member
|
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
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
pipoman Member
|
Nice to hear. Thank you very much for your help and your reactiveness guys :dude:
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Markus.Kreisel Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
pipoman Member
|
Sound really good. I just can't wait to give it a try.... Thanks a lot!
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Markus.Kreisel Administrator
|
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 |
||||||||||||||||
| |||||||||||||||||
| Current time is 07:50 am | Page: 1 2 |
| .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 | |
Sisulizer software localization tool - Three simple steps to localize