Mega Search
23.2 Million


Sign Up

Make a donation  
Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization

Hi,

I am trying to use the ITE in C++Builder XE3 for the first time and have created a small project which builds and runs correctly.  I added a new language to it (German) and opened the Form and RC files in the translation editor and entered some translations there.  When I try to build the project I get the following error message.
{code}
Checking project dependencies...
Building BPAlert_DEU.bdsproj (, Win32)
CGRC Command Line:
  CGRC.exe
  "C:\Users\Ciaran\Documents\RAD Studio\Projects\BPAlert\DEU\BPAlert.rc"
  -I"c:\program files (x86)\embarcadero\rad studio\10.0\include\windows\vcl;.."
CGRC Command Line:
  CGRC.exe
  "C:\Users\Ciaran\Documents\RAD Studio\Projects\BPAlert\DEU\Win32\Debug\BPAlert_DRC.rc"
  -I"c:\program files (x86)\embarcadero\rad studio\10.0\include\windows\vcl;.."
[Fatal Error] F2039 Could not create output file 'C:\Users\Ciaran\Documents\RAD Studio\Projects\BPAlert\Win32\Debug"\BPAlert.DEU'
Failed
Elapsed time: 00:00:00.0
{code}

I presume that the error is to do with the fact that there is a double quote character in the output path in the error line (...Win32\Debug"\BPAlert) whereas the correct path should be ...Win32\Debug\...

I have searched through the various files in my project and cannot find any sign of the incorrect path anywhere.   I would appreciate any suggestions as to how I can correct this issue.  Note that the two CGCR.exe lines appear to run correctly as they do not produce any errors if I run them from the command line and they each update the timestamp on the appropriate .RES file.

Regards

Ciaran

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 26-Jan-2013, at 9:52 AM EST
From: Ciaran Manning
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
Hi,
I'm having the same problem.
I've followed the instructions that Delphi provided to use the translation tools.  Everything works fine, until I get to the point of compiling the program.  If I compile only the English, then it works fine. However if I do a Build All Projects then the compiler gives an error.

The compiler I'm using is the newly-downloaded Trial version of RAD Studio XE3 (although I'm only using the C++ Builder portion of it - and the Trial version only appears to come as the Architect version).
The program is just a simple Hello World program. I started by creating a VCL forms project and placed one TLabel on the form with the Caption=Hello World.

Building at that point worked fine. Then I went to Project->Languages->Add.. and added the first language in the list (Afrikaans).  I did not bother to try to edit the translation (previous attempts of that worked fine).

The next step was to do a Project->Build All Projects which failed with 
Fatal Error F2039 Could not create output file 'C:\Users\Helena\Documents\RAD Studio\Projects\HelloWorld2\Win32\Debug"\HelloWorldProj.AFK'

The quotation marks are shown the same way they appeared in the error message.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 19-Apr-2013, at 10:42 AM EST
From: Bruce Petty
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
Hi Bruce,

I found the answer after filing a bug report.   It turns out that there is a bug in this part of Rad Studio that means it is unable to handle paths with spaces in them which is particularly troublesome because the default project path includes a space.   If you change your "RAD Studio" folder to "RADStudio" then the compile should run correctly.

Regards

Ciaran

> {quote:title=Bruce Petty wrote:}{quote}
> Hi,
> I'm having the same problem.
> I've followed the instructions that Delphi provided to use the translation tools.  Everything works fine, until I get to the point of compiling the program.  If I compile only the English, then it works fine. However if I do a Build All Projects then the compiler gives an error.
> 
> The compiler I'm using is the newly-downloaded Trial version of RAD Studio XE3 (although I'm only using the C++ Builder portion of it - and the Trial version only appears to come as the Architect version).
> The program is just a simple Hello World program. I started by creating a VCL forms project and placed one TLabel on the form with the Caption=Hello World.
> 
> Building at that point worked fine. Then I went to Project->Languages->Add.. and added the first language in the list (Afrikaans).  I did not bother to try to edit the translation (previous attempts of that worked fine).
> 
> The next step was to do a Project->Build All Projects which failed with 
> Fatal Error F2039 Could not create output file 'C:\Users\Helena\Documents\RAD Studio\Projects\HelloWorld2\Win32\Debug"\HelloWorldProj.AFK'
> 
> The quotation marks are shown the same way they appeared in the error message.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 19-Apr-2013, at 11:45 AM EST
From: Ciaran Manning
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
Hi Ciaran!
Thank you so much for responding. I did not expect anyone to respond. I had tried Embarcadero and they wanted $300 to tell me how to get around their bug.
I first tried to translate a Hello World program with XE and then used the trial XE3 and got the same response. Your work-around worked! It did allow the build without failure however after doing a Project->Language->Set Active to change the language and then the Build All Projects, the program which Runs still shows only English. I put other words in for both the Form Caption and a single TLabel caption.
During some of the early discussion with Embarcadero they gave me a link to:
http://cc.embarcadero.com/item/26954
which is a webinar where the lecturer talks about doing a translation. Unfortunately most of the lecture just shows a black screen because the webinar was apparently live and so only shows the few saved Power Point images but then goes black when the lecturer is trying to demonstrate something.
If you have ever been able to do a complete translation and gotten it to actually show a different language when running, I would be very grateful to know how you did it.
Any helpful links would be much appreciated. I've read everything (I think) that Embarcadero has put out.
Bruce

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 29-Apr-2013, at 1:10 PM EST
From: Bruce Petty
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
Ciaran,
By the way, I've tried the trial XE4 and they've apparently changed that part of the program so that just changing the folder name so it has no spaces is apparently not sufficient anymore.  When running Build All Projects now on XE4 (with RAD Studio changed to RADStudio) it fails but no longer shows any kind of reason for the failure.
Bruce

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 29-Apr-2013, at 1:14 PM EST
From: Bruce Petty
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
Hi Bruce,

I discovered that when you change the active language in the IDE it creates (or modifies) two  registry keys in HKEY_CURRENT_USER/Software/Embarcadero/Locales.   The keys are named after the path and filename of your project so in my case they are called C:\Users\Ciaran\Documents\RADStudio\Projects\ITE-Test\.\Win32\Release\Project1.exe and C:\Users\Ciaran\Documents\RADStudio\Projects\ITE-Test\Win32\Release\Project1.exe   These both seem to point to the same folder so I don't know why one has a (redundant)
 "./" in the path.  When I set my active language to French the contents of both of these is "FRA" and when I change it ti English the contents are "en-GB".

The catch seems to be that it takes while for the IDE to realise that the path to the project has changed since when I looked at this after first changing my active language to French I found two entries as above with FRA as the locale BUT with a space in "RAD Studio".   When I ran the program it showed the English version of the form.   When I changed it back to English and then Back to French again I ended up with the correct registry entries and the program now displays the Frence version if I run it i
n the IDE.

I can see that I have Project1.exe and Project1.FRA files in my release folder and my understanding is that if I deploy the FRA file with the application then anyone whose PC is set to a french locale will load the form and strings from that file instead of the exe file however I have not yet tried that.

Just for the sake of completeness there is a bit of sample code on the embarcadero website http://docwiki.embarcadero.com/RADStudio/XE3/en/Dynamic_Switching_of_Resource_DLLs showing how to switch languages at runtime and the code is as follows.

{code}
const FRENCH = (SUBLANG_FRENCH << 10) | LANG_FRENCH;
 
if (LoadNewResourceModule(FRENCH))
    ReinitializeForms();
{code}

However if you try to use this you discover that LoadNewResourceModule() and ReinitializeForms are not recognised functions.   It turns out that this code calls functions defined in reinit.pas which is part of the RichEdit sample project that comes with RAD Studio. In the ..Samples/Delphi/VCL/Richedit folder.   This sample project apparently lets you select one of four languages and switches between them on command.  However the sample is a Delphi Project and I only have the C++ version of RAD Studio so I
 can't use it.   I haven't tried converting the code to C++ and I'm not sure whether SUBLANG_FRENCH and LANG_FRENCH are predefined constants or whether they also rely on the reinit.pas file. 

I think your best option is to change the active language a couple of times and check the registry entries.  You can edit the registry by hand if needed.  Apparently you just need a single entry named with the full path to your program file and containing the locale code that you require as detailed here http://docwiki.embarcadero.com/RADStudio/XE3/en/Using_Resource_DLLs 

Regards

Ciaran

> {quote:title=Bruce Petty wrote:}{quote}
> Hi Ciaran!
> Thank you so much for responding. I did not expect anyone to respond. I had tried Embarcadero and they wanted $300 to tell me how to get around their bug.
> I first tried to translate a Hello World program with XE and then used the trial XE3 and got the same response. Your work-around worked! It did allow the build without failure however after doing a Project->Language->Set Active to change the language and then the Build All Projects, the program which Runs still shows only English. I put other words in for both the Form Caption and a single TLabel caption.
> During some of the early discussion with Embarcadero they gave me a link to:
> http://cc.embarcadero.com/item/26954
> which is a webinar where the lecturer talks about doing a translation. Unfortunately most of the lecture just shows a black screen because the webinar was apparently live and so only shows the few saved Power Point images but then goes black when the lecturer is trying to demonstrate something.
> If you have ever been able to do a complete translation and gotten it to actually show a different language when running, I would be very grateful to know how you did it.
> Any helpful links would be much appreciated. I've read everything (I think) that Embarcadero has put out.
> Bruce

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 29-Apr-2013, at 3:32 PM EST
From: Ciaran Manning
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
Ciaran,
Thank you so much for your very helpful suggestions! Because of them I now have it working on the trial XE3, XE4, and even back on the original XE. Since it works with XE, I won't need to buy the newer compiler.  I don't understand why Embarcadero has allowed these same errors to go through so many versions without fixing them.
All of my tests have just been with a small Hello World program but I have a lot of confidence now that they will work with the larger program that must be translated.
I can see the icon stating that you've provided a complete answer for me but I don't know how to mark it.
Bruce

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 30-Apr-2013, at 3:51 PM EST
From: Bruce Petty
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
Glad to help Bruce.

I think that because I posted the original question in the thread that I can't be awarded any points for providing the answer to my own question.  Still we both know more than we did before so that's reward enough.

Ciaran

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 30-Apr-2013, at 6:13 PM EST
From: Ciaran Manning
 
Re: Build fails for language files  
News Group: embarcadero.public.cppbuilder.localization
I may have had a false sense of excitement.  Everything I've tested to date was on a simple "Hello World" program.  However when I try to do the translation on my complete program, it shows three E1026 errors.
File not found: 'vcl\DBLOGDLG.dfm'
File not found: 'CPOCII_DS.res'
File not found: 'Text.res'

I found something on the internet about the first error. I found the DBLOGDLG.dfm file in Quality Central Report #: 95442 and followed the suggested work-around but it doesn't seem to work.  I've read a little about the .res files but do not understand the problem.

I'll continue to work on these and will post the answer if I find it.
Ciaran, if you or anyone else knows the answer, please post it.
Thanks,
Bruce

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 6-May-2013, at 9:28 AM EST
From: Bruce Petty
 
Re: Build fails for language files [Edit]  
News Group: embarcadero.public.cppbuilder.localization
For the vcl\DBLOGDLG.dfm error, the problem was mine. I have several languages to translate into and had not copied the DBLOGDLG.dfm file into all of them.
Two errors left.  Concerning the CPOCII_DS.res error, the CPOCII_DS.rc file does not contain anything.  I'm not sure when it was created.  I've tried just removing the CPOCII_DS.rc file. The compiler would not allow me to remove it after the language was added so I removed the language and then was able to remove the CPOCII_DS.rc file and now have added the language back in.
The text.res file was there but had been placed by the linker into the specified output file (debug). Then while it was doing the translation portion it apparently couldn't remember where it was placed.  I put a copy of the text.res file in the project's root folder and the linker was able to finish.
So at this point I have a completed project, I think.

Nope. It still doesn't work. I noticed that I was not able to select Project->Languages->Set Active (the selection was grayed out). So I closed the IDE and reopened it. All of the other languages can still be seen in the project group but both Remove and Set Active are grayed out.  When I tried to again Build All Projects, both the CPOCII_DS.res and text.res errors reappeared.

So I again added all of the original languages (using Project->Languages->Add..).  That ungrayed the Set Active function which I immediately set to one of the languages (in this case Italian) and then did the Build All Projects. It worked, again. And when I ran the program it was immediately showing in Italian.

Edited by: Bruce Petty on May 6, 2013 9:19 AM

Edited by: Bruce Petty on May 6, 2013 9:36 AM

Edited by: Bruce Petty on May 6, 2013 9:58 AM

Edited by: Bruce Petty on May 6, 2013 11:22 AM

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 6-May-2013, at 4:01 PM EST
From: Bruce Petty