I am developing a MMC 3.0 snap-in and have a framework in place to localize all string literals at run-time.
However, the MMC inserts lots of 'default' menu items, actions and descriptions, none of which I can access programmatically. For example, the "Refresh" & "Help" buttons.
Can anyone suggest a way of accessing these items in code, in order to translate their properties?
I suspect that the UI elements managed by MMC itself are localized according to whatever rules govern the UI language used in other parts of Windows. So if you install a French language pack and make it the default, I would assume that the basic MMC UI elements would then appear in French.
Related
I had read documentation about localizing Embarcadero DocWiki.
But I do not know how to:
change language in Run-Time - for example I would to click in application menu change language to English or Polish
Show translated text in dialogs, e.g: ShowMessage('Zmieniłeś język');
1.
There was sample project (shipped with Delphi) called RichEdit which had run-time change of language. To achieve that, Reinit unit was used (you can take it from here) which actually reloads all the resources.
It's working normally on simple programs like that, but may be real pain to implement in something more complex, as all the controls on form are reverted to initial state in which they have been at start-up, so it's your responsibility to keep your data consistent.
Though in proper implementation where all the application logic is separated from GUI (so there are no vars on TForm, no storing user data in edit boxes etc), it should work normally.
See RichEdit sample's source code to understand how to use Reinit.pas
2.
The classical approach is to use ResourceString. In interface section of your unit or better in separate unit, write:
ResourceString
ChangeLanguageStr = 'Zmieniłeś język';
//another strings here
and for showing message:
ShowMessage(ChangeLanguageStr);
These strings will be shown in translation manager.
Is there a way to add to easily add text for a not included language to a control that is included in Orbeon, ie what having to recompile Orbeon / contribute and wait for new release? In particular, adding "Please Select:" in another language for select components.
I have seen http://doc.orbeon.com/contributors/localizing-orbeon-forms.html, but was hoping there was a way such as adding it to a property in properties-local that could speed up the process.
The localizations for a XBL controls are embedded in the XBL file itself. So no unfortunately there is no way to override these via properties at this point.
For adding a new language to Form Runner, you also need to add that language to the Form Runner resources.xml file. Adding resources via properties can only patch existing Form Runner resources, but not create new ones. That is a limitation which, in theory, could be lifted, with some work.
I'm using embedded Delphi 2010 localization tools and I can't find the way how to change interface language at runtime. So, how can I change interface language at runtime ?
VCL is not designed such way that it would make runtime language switch easy. The RichEdit demo is actually using form reallocation. It is too strong action for a language switch because you will lose everything you have done for the forms on runtime.
Some localization tools have implemented add-on to VCL to implement runtime language switch. Some use components together with proprietary translations data to perform this. Some use the standard resource DLL with some units linked to application to perform language switch. For example take a look at this document. It describes step by step who to perform runtime language switch without needing to reallocate forms and without losing any data.
http://www.sisulizer.com/translation/vcl/VCL.pdf
Be careful with arrays containing resourcestring!
See the RichEdit demo in Demos\DelphiWin32\VCLWin32\RichEdit directory.
I have a large application which i want to migrate to Arabic. I have defined the strings that we show to the user under the resourcestring keyword.
I am using the External Translation manager provided with Delphi 6. However, I am not very much comfortable using the tool. I want to create a resource only dll with all the translated strings like how the Delphi ETM does, and then switch between languages at run-time at the click of a button.
I was able to link the resourcestrings to the Dll, but how about form's captions and hints and the component properties? I am loading the Dll at runtime depending on the language, but the form properties are not reflecting as they were not available in the Dll.
Any pointers in the right direction ???
Thanks
Rahul W
What the Delphi localization tool and runtime support do is to redirect resource loading - including forms - from the executable to the DLL. Forms, their components and controls (non default properties) are stored as resources into the executable (as long as you don't create them fully at runtime - but then you would have to set their properties one by one).
Thereby if you want to work alike the standard translation tool you have to work the same way. What the DLL Resource Wizard does is to extract all project .dfm (and those you add manually) and resourcestrings to a copy that can be localized. When an app is started the form loading code checks from where the .dfm should be loaded. You should override this code to load your resources.
Be aware that changes language at runtime may need a different approach, because loading a whole form from resources may "reset" it to the creation state. On the other hand, compared to approaches like gettext, it allows to localize far more than the form text, including images, colors, and to adapt control sizes to the new string easily. IMHO gettext is good for simple needs, but when localization becomes a complex task and you may need to localize for a very different "culture", more powerful tools are needed.
I am localizing my winform application for french and japenese. We have fileOpenDialog used at some places, when I change the CurrentUICulture to ja-JP or fr-FR, application displays the localized screens But the dialog boxes are shown in English, i.e default OS setting.
Is it not localizable ? or there is any alternative to it?
Thanks.
The Common File Dialogs and Common Item Dialogs are part of Windows itself and use the language of the underlying Windows installation. The only way to change their language is by reinstalling a different language variant of Windows.