View Issue Details

IDProjectCategoryView StatusLast Update
0004938JEDI VCL00 JVCL Componentspublic2009-12-18 12:08
ReporterdelphaberAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionopen 
PlatformCore2Duo 2Ghz,2GB RAM,128MB GPUOSWindows XP Professional 32BitOS VersionTurbo Delphi PRO
Product VersionDaily / GIT 
Target Version3.40Fixed in Version3.40 
Summary0004938: JvProgramVersionCheck Form not being translated if exe is compiled with runtime packages
DescriptionHi,

the form saying there's a new version available won't be translated in my language(italian).

It happens when I compile my project with run time packages.

I've added italia jvcl.mo into "locale/it/LC_MESSAGES/" and added this code to an unit I initialize before others:

bindtextdomain('jvcl', ParamStr(0) + 'locale');

But this didn't work.

If I DO NOT include that code AND I DO NOT compile with run time packages, the form got translated.

I attached a demo based on jvcl examples.
TagsNo tags attached.

Activities

2009-09-16 02:39

 

JvProgramVersionCheck.zip (148,806 bytes)

obones

2009-09-22 16:23

administrator   ~0016137

Two things:

1. The call is actually AddDomainForResourceString('jvcl'); and not "bindtextdomain"

2. The fact that it does not work with packages is because you did not select "USE_DXGETTEXT" in the installer. Once selected, you must REBUILD the packages

Please verify all this and let us know how it goes.

delphaber

2009-09-26 18:14

reporter   ~0016195

Hi Obones,

I already use "dxgettext support". This time I've checked also "Build packages" and installed jvcl (today svn) as usual.

I've changed bindtextdomain ---> AddDomainForResourceString('jvcl'), but I'm still having problems.

That form will be translated only if I do NOT compile with run time packages. I've tried also to copy my "locale" folder to Borland BPL folder (where jvcl bpls are), but that doesn't work.

Thank you in advance.

obones

2009-10-05 14:54

administrator   ~0016767

Hum, I'm seeing this as well. The main application gets the translation, but not the JVCL forms. Weird...

2009-10-06 09:12

 

4938.zip (263,005 bytes)

outchy

2009-10-17 18:27

administrator   ~0016779

Apparently JvGnuGetText is not correctly initialized when an application has designtime packages. The SupportPackages parameter of the function HookIntoResourceStrings has to be set to true when an application is compiled with runtime packages.

However, this flag must be false when the package is loaded in the IDE but I don't know how to flag this situation.

I'm attaching a patch to this report that shows how to get things alright using the following steps:
 - uninstall the JVCL,
 - patch JvGnuGetText with the supplied patch,
 - open the JVCL package group in the IDE,
 - build every thing (do not install),
 - open the demo application attached to this report (4938.zip),
 - the IDE will complain it is not able to find some JVCL component, hit "cancel",
 - execute the application

--> the application is translated when it is compiled with runtime packages (as well as when it is not compiled with runtime packages)

2009-10-17 18:28

 

4938.patch (960 bytes)
Index: JvGnugettext.pas
===================================================================
--- JvGnugettext.pas	(revision 12557)
+++ JvGnugettext.pas	(working copy)
@@ -424,10 +424,11 @@
 // because it makes this unit independent of the SyncObjs unit
 (**************************************************************************)
 
-{$ifdef CLR}
 uses
-  System.Globalization, System.Diagnostics, System.Windows.Forms;
-{$endif}
+  {$ifdef CLR}
+  System.Globalization, System.Diagnostics, System.Windows.Forms,
+  {$endif}
+  JclSysUtils;
 
 type
   TTP_RetranslatorItem = class
@@ -3588,7 +3589,7 @@
   {$ENDIF DELPHI2009OROLDER}
   HookLoadStr := THook.Create(@SysUtils.LoadStr, @SysUtilsLoadStr);
   HookFmtLoadStr := THook.Create(@SysUtils.FmtLoadStr, @SysUtilsFmtLoadStr);
-  HookIntoResourceStrings(AutoCreateHooks, False);
+  HookIntoResourceStrings(AutoCreateHooks, IsCompiledWithPackages and not IsRunningInTheIDE);
   {$endif}
 
 finalization
4938.patch (960 bytes)

outchy

2009-10-17 18:30

administrator   ~0016780

one precision: the patch references a function named "IsRunningInTheIDE", this function does not exist and we have to find an easy way to get this flag. Just remove "and not IsRunningInTheIDE" before the compilation of JvCoreD**R.bpl.
but remember: do not run the patched JvGnuGetText within the IDE...

delphaber

2009-10-17 18:35

reporter   ~0016781

Thank you! I'm going to try this patch this evening. Thank you for your support ^^

delphaber

2009-10-25 18:56

reporter   ~0016822

:/ Sorry, I haven't find time to test it. Plus today JCL fails to compile (i've reported it :) )

I'll write here (I hope) soon :)

AHUser

2009-10-25 19:47

developer   ~0016824

The JCL compile errors are fixed.

delphaber

2009-10-25 22:36

reporter   ~0016826

That Worked! Thank you so much!

So basically I have to ship the patched JvCoreD10R.bpl to my clients, right?

delphaber

2009-10-25 22:42

reporter   ~0016827

Or maybe I should ship all jvcl run time bpls (compiled with patch)

obones

2009-12-18 12:08

administrator   ~0017009

Just the JvCore should be enough

Issue History

Date Modified Username Field Change
2009-09-16 02:38 delphaber New Issue
2009-09-16 02:39 delphaber File Added: JvProgramVersionCheck.zip
2009-09-22 16:23 obones Note Added: 0016137
2009-09-22 16:23 obones Status new => feedback
2009-09-26 18:14 delphaber Note Added: 0016195
2009-10-05 14:54 obones Note Added: 0016767
2009-10-05 14:54 obones Status feedback => confirmed
2009-10-06 09:12 obones File Added: 4938.zip
2009-10-17 18:27 outchy Note Added: 0016779
2009-10-17 18:28 outchy File Added: 4938.patch
2009-10-17 18:30 outchy Note Added: 0016780
2009-10-17 18:35 delphaber Note Added: 0016781
2009-10-25 18:56 delphaber Note Added: 0016822
2009-10-25 19:47 AHUser Note Added: 0016824
2009-10-25 22:36 delphaber Note Added: 0016826
2009-10-25 22:42 delphaber Note Added: 0016827
2009-12-18 12:08 obones Note Added: 0017009
2009-12-18 12:08 obones Status confirmed => resolved
2009-12-18 12:08 obones Fixed in Version => 3.40 - not yet released
2009-12-18 12:08 obones Target Version => 3.40 - not yet released