How to completely disable localization?

Public forum for discussing TScaleRichView (shareware addon to TRichView providing WYSIWYG editing)
Post Reply
Marius2
Posts: 3
Joined: Thu Jun 04, 2015 8:37 pm

How to completely disable localization?

Post by Marius2 » Fri Jun 12, 2015 1:25 pm

Hello,

We are using dxGetText to translate our components and applications and because there's little point in including multiple translation engines in a single application I would like to use the dxGetText engine for TRichView(actions). I already enabled the {$RVA_NO_*** etc. conditional defines but I still see a lot of calls to the RvsLocatisation.

Is there an option to avoid any of the standard localisation? In the helpfile the first thing I read is "RichViewActions require localization, even if you use only one UI language". Why is that? Is that only in the (nice) demo's of is this also used in the RichView sources?

Any other option available?

Regards,
Marius

Sergey Tkachenko
Site Admin
Posts: 13637
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Fri Jun 12, 2015 7:20 pm

It is not possible to remove calls of RichViewActions procedures retrieving text messages.
Even if you disable calling methods assigning values to captions when dialogs are created, there are message boxes and controls that change captions depending on their state.
Can you use "Resource language" pseudo language for localization?

Marius2
Posts: 3
Joined: Thu Jun 04, 2015 8:37 pm

Post by Marius2 » Sat Jun 13, 2015 7:38 pm

That is a pitty, so now we have actually two engines replacing text in the userinterface, it is slower (since it is translated twice), it is adding 'unwanted' code and resources to the application (and more registration stuff because of the registration stuff resulting in a bit slower startup time). I'm alway's disapointed when component developers try to be 'smart' and try to translate there own little corner of a application without any consideration to the available multilanguage translation tools out there. They should use the guest OS for language settings/measurements and just use plain resource strings (dont get me wrong, lots of people will still enjoy your solution!).

I'm not sure what you mean with "Resource language pseudo language". The usual bunch of translation tools out there like dxGetText, Sisulizer and ITE (etc. etc.) can pickup everything in the usual dfm's and resource strings. I dont think resourcestrings can be mixed easely with the early unit initialization registration and "TRVAMessages" storage you are using (unless you are using something like the ButtonCaptions in dialogs.pas).

I do get curious to see what idea/solution you have for this...

Sergey Tkachenko
Site Admin
Posts: 13637
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sun Jun 14, 2015 1:43 pm

"Resource language" is a special language of RichViewActions created to allow using external (i.e. not ours) translation tools.
All strings for this lanugage are stored in resources (using "resourcestring").
You can find it in RVAResourceLanguage.pas.
In RichViewActions.inc, you can disable all languages but "Resource language".
Then, if your localization tool supports replacing resourcestring, just translate them, and you receive a complete your own translation. Do not translate any other strings in RichViewActions, just resourcestrings from RVAResourceLanguage.pas.
For ScaleRichView, you also need translating resourcestring from SRVAResourceLanguage.pas

Marius2
Posts: 3
Joined: Thu Jun 04, 2015 8:37 pm

Post by Marius2 » Tue Jun 16, 2015 12:38 pm

Sergey Tkachenko wrote:Then, if your localization tool supports replacing resourcestring, just translate them, and you receive a complete your own translation. Do not translate any other strings in RichViewActions, just resourcestrings from RVAResourceLanguage.pas.
For ScaleRichView, you also need translating resourcestring from SRVAResourceLanguage.pas
That looks like a very nice workaround, thank you!

Post Reply