LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to run UI localizer utility

Hi all, I must localize a project for a new customer and I am experimenting the UI localizer utility.
I succesfully loaded my UIR file, translated the strings and produced both the LWL and LWD files. Next I used LoadLocalizedPanel to load the main panel receiving the error -6000, Invalid or corrupt language file.
From this moment on every attempt to use the UI localizer fails with error in line 1367 file "uiobjects.c"! Smiley Surprised
I tried with a different panel, with the panel saved in text format and running the utility from an empty project with no success! Smiley Mad
 
What can be happening? Is there any solution apart reinstalling CVI from scratch?
I'm running CVI 6.0.0 on a WinXP machine with SP2 installed.
 
On my machine CVI 7.1 is installed too: may this be causing the problem? I have not used localization utility from CVI 7, though...
 
 
UPDATE
I was able to open a smaller UIR file with less and simpler panels (original file has 18 panels with several decorations and some ring controls -none of them with empty labels, though): I'm telling this because I saw that these may be causing errors in the UI localizer.
So it seems that my UIR file has some problems and I can proceed debugging panel-by-panel, but the *big* question is:
Why was I able to open and translate it on the first run???!?! Smiley Surprised Smiley Surprised Smiley Surprised

Message Edited by Roberto Bozzolo on 04-12-2006 05:52 PM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 10
(4,963 Views)
Roberto,

Is it possible that you modified the panel after generating the lwl file? Before CVI 8.0, the localization utility was very unforgiving of changes made to the panel after you generate the lwl file, but before it's been localized. You can read some of the details here. If that's not the reason, and assuming that you're also not using any controls that CVI 6.0 did not know about, then I'm not really sure what could be causing it. Also, did you try using the localui.fp / localui.lib from the CVI 7.1 folder to see if it makes any difference?

Luis




0 Kudos
Message 2 of 10
(4,953 Views)
Luis, thanks for your reply.
 
No, I'm not sure the panel has not been modified between obtaining the LWL file and loadin it in the project. I tried to restore the file from a backup I made recently, but since it is equal in date and size maybe it has been taken after the modifications have been done...
Nevertheless, in this case I would expect the -6000 error, but not the problem in running the utility. BTW, in the code I am using LoadLocalizedPanel and not LoadPanel+LocalizePanel.
Moreover, in case I need to perform further changes on the panel, what would I do? I'd exepect I would be able to load the panel and its corresponding LWL file and simply update the original translated file, or do I need to translate all the UIR from the beginning?
 
The whole project was born in CVI6 and I am updating it using the same version so there is no possibility of controls too recent for the IDE to handle them. Would your last comment signify that I can use tools from version 7 in a cvi6 project?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 10
(4,946 Views)

Another question: can different UIR files be associated with one only LWL file? That is: may I merge two different LWL file (which are plain text files) and load panels from different UIR files using this merged LWL?

LoadLocalizedPanel (0, "file1.UIR", PANEL1, "english.lwl", &panel1H);
LoadLocalizedPanel (0, "file2.UIR", PANEL2, "english.lwl", &panel2H);



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 10
(4,937 Views)
Luis, with a bunch of trial-and-error I found that the problematic panel is the one attached: I tried modifying the panel, changing fonts and labels, adding labels where they aren't but I couldn't avoid the error when loading the GUI into the localizer. Could you please look at it and discover which control is the wrong one?
 
I tried also to merge lwl files and it seems that the system is working correctly (I added the strings respecting the alphabetical order of panel names) : is this procedure someway problematic in your opinion? Having one lwl file only makes the project structure simpler and simplifies the distribution of the application.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 10
(4,929 Views)
Roberto,

I didn't read your description very carefully the first time. I didn't realize that you were seeing the error event when you were trying to read the .uir into the utility (I had assumed it was only at run time). Certainly you should be able to load the .uir into the utility at any time, otherwise you could never be able to update your .lwl file whenever you add controls.

I was able to reproduce your error with the specific.uir that you attached in the other post. The error only happens in 6.0. It does not happen with the 7.0, 7.1, or the 8.0 version of the utility.

The reason this error is happening is because of a control that was added to CVI at the very last minute, just before the 6.0 release: the recessed narrow frame decoration. Unfortunately, we inadvertently neglected to update the localization utility to take this control into account. Because your .uir uses this control, the localization utility is complaining that it doesn't know about this control. We must have fixed the problem shortly after 6.0 was released, and so this problem went away.

You can do one of two things to workaround the problem:

1. You mentioned that you also have CVI 7.1 installed. If so, you should be able to use the localization utility from CVI 7.1 to perform the translation. Then, when you call LoadLocalizePanel, you would also have to make sure that you are using the version of localui.fp that is in your CVI71 installation. (So, the answer to your last question is, yes, in most cases you can use a tool from a later version of CVI. Because this .fp come in static library form, it will become part of your executable, and so you won't need to deploy it whenever you need to run your project in a different PC).

2. Replace your recessed narrow frame with a different decoration.

Luis
0 Kudos
Message 6 of 10
(4,913 Views)
Roberto,

I was prepared to say that you couldn't do this, but then I saw your next post, where you say you were able to make it work. I can tell you that we never intended for them to be "comnbinable" and I'm a bit surprised that you were able to make it work. I suppose that if there are no conflicts at all between the panel/control/menu names of one .uir and the other one, it should be okay, but I'm still a bit surprised...Smiley Happy

Luis

0 Kudos
Message 7 of 10
(4,913 Views)
Oy. The order in which the forum displays the answers is not always the most intuitive...

Just to clarify: my previous post is answering the question about combining multiple .uir files into a single .lwl.

Luis
0 Kudos
Message 8 of 10
(4,912 Views)

Luis, thanks for your help: I modified the decoration and the localizer is working now. I guess I should have detected it by myself: I remember I red something about decorations giving problems with the localizer but I forgot it when facing with the actual problem...

Regarding merging the lwl files, remember that originally I had one UIR only, and I splitted it into 3 files only to detect which were the faulty panel: there were no panels with duplicated names and this is probably the reason why merging has worked: I produced a file as if the UIR were the original single one (infact, my intention is to come back againg to one UIR only).

One last question: in case I need to modify some control on the panels or I want to change some translated text, there is a way to reload the uir AND the original LWL file and change only the modified control? Or should I create an UIR with only the modified panel, translate it and manually merge the modified labels into the big LWL file?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 10
(4,899 Views)
Roberto,

Keep in mind that the localization utility never looks at an existing lwl. The lwl file is necessary only at runtime, in the LoadLocalizePanel function. (Because the uir and lwl files need to be in sync, you couldn't make changes to a .uir and then reload it into the localizer along with an out-of-date lwl...)

But this doesn't mean that you have to re-translate the entire uir every time you make a change. Nor do you have to create a different uir and merge the lwl files manually, as you suggested. It is for this purpose that the lwd file is useful. It's essentially a dictionary that is intended to preserve associations between words in the two languages, so that the next time you need to create an updated lwl file, you don't have to translate everything manually again.

So let me give you an outline of the typical process:

1. Create uir.
2. Load uir in localizer, and perform translations.
3. Obtain both an lwl (language file) and an lwd (dictionary file) from the localizer when you're done (File>>Export Language and Dictionary>>Export Strings, respectively).
4. Use the uir and the lwl in your program.
...
5. Make a change in the uir.
6. Load the new uir in the localizer.
7. Load the lwd in the localizer (Dictionary>>Import Strings).
8. Translate the new controls only (the existing controls should have had their text translated by the previous step).
9. Repeat step 3.
etc...

The thing to keep in mind, that affects most users, is that if you skip steps 6-9, in versions of CVI older than 8.0 you will probably get an error in LoadLocalizePanel, and unfortunately the error isn't always very helpful. You can still get an error in 8.0, but it's a lot less common.

Hope this helps,

Luis
0 Kudos
Message 10 of 10
(4,886 Views)