LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW NXG at the controls is the caption available?

Solved!
Go to solution

Hi everyone, 

 

Hopefully this can bring some clarity--

 

For the case of localization in LabVIEW NXG, the editor now makes a distinction between the "label" text and the "name" of the control that the code references. Using Localized String Dictionaries and the Get Localized String node, you can programmatically change the text that is displayed at runtime. However, the name of the control will always stay the same on the block diagram side. NI is looking to this as a better path forward for localization of LabVIEW apps. 

 

If you're looking to just change a few labels and potentially don't need a whole dictionary, you also can go about this manually. From the control reference, you can get the label reference, which offers read/write access to the text of the label for NXG versions 2.0 and beyond. 

 

Please let me know if this doesn't cover the use case you are concerned with. Your feedback is extremely important to us! 

 

Thanks,

Rita Prather
Software Product Manager
rita.prather@ni.com
National Instruments
Message 11 of 19
(1,539 Views)

The seems a lot more complicated... BUT... if it improves localization efforts, I AM ALL FOR IT!

 

It's scary confusing, though - Now labels function more like captions, and the new name functions more like a label.  Perhaps the new "label" property should have been called something entirely different also, so pre-NXG LabVIEW developers don't go looking for a caption property and dismiss the label property as not writable?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 19
(1,513 Views)

How is this handled when you import code?

0 Kudos
Message 13 of 19
(1,496 Views)

So:

caption becomes label

label becomes name

 

It seems mostly confusing, while providing the exact same functionality. I don't see why changing terminology is better for localization?

 

Message 14 of 19
(1,481 Views)

I'm schrodinger's fence-sitter.  I'm on both sides at the same time.....

 

On One hand, changing the handling fo such a standard feature is annoying BUT seeing how the name and Label (CG) of the controls were inherently linked before, having the "Label (NXG)" be disconnected from the actual name of the control will perhaps make this differentiation more obvious.

 

I presume the name of the control can then be changed via the properties pane on the right.  I haven't delved into NXG for a while now.  Is it now prohibited from having two controls with the same name in a VI?

0 Kudos
Message 15 of 19
(1,479 Views)

@Intaris wrote:

Is it now prohibited from having two controls with the same name in a VI?


Yes, that was the plan, and I think it's like that.

0 Kudos
Message 16 of 19
(1,474 Views)

From my point of view it is a bit confusing, because at the time of execution on the front panel the label behaves like caption. In my case, normally in the block diagram I use the label using the Pascal Case and Camel Case nomenclature, and on the front panel I use the caption with the name that will be represented to the client. By using the caption on the front panel, you can align the controls showing the final result that the client will see, in this case, it would be necessary to go running the application to visualize the final result and to be able to align the controls, it seems to me a job tedious.

 

That said, if it is very complicated to implement and dispense the caption apart greater functionality, I think I can serve the proposal of @cool_ranch_doRITAs.

 

Can anyone upload an example using Localized String Dictionaries and Get Localized String?

0 Kudos
Message 17 of 19
(1,445 Views)

Sorry to keep y'all waiting. Here's an example project that uses the concepts we talked about here. I can't take credit for it, but I can pass along instructions: 

 

"The attached example uses the ‘Export strings’ feature, and by hand I created other folders for different languages that have fake localized text in them. A “script” basically goes like this:

  1. Open and save your UI VI
  2. In the ‘Document’ tab, choose “Export strings”
  3. Locate the string dictionary file reported when the “Export” completes. You can toggle the files filter in the files pane (project explorer) to make this easier.
  4. Make copies of the directory that contains the file, renaming the directory based on your desired target language. The names to use for different languages are definedhere (see the “Language tag” column in the giant table).
  5. In each folder, translate the strings to the language you used for the folder name.
  6. Reload your project.
  7. You’ll be able to preview in the different languages.
  8. If you want to actually build the VI to include all the languages at run-time, do a recompile of the VI (usually, I use up arrow on a control to move it one pixel, then down arrow to move it back). Save and you’re ready to go.

 

For a quick demo, you can just open the attached project and, in the ‘Document’ tab, preview what the panel will show if the VI is run in an OS with the given language configured in the OS and all the default product settings."

 

Note that the dictionaries don't actually have the translated words in them, they simply add a [EN-US] or [DE] distinction, for example, depending on the language you are previewing. You can open up the XML files and find the panel item of interest, and change the text that is displayed by editing the text between <loc> and </loc>. Just save the document and re-preview the VI. 

 

I hope this helps!

Thanks,

Rita Prather
Software Product Manager
rita.prather@ni.com
National Instruments
0 Kudos
Message 18 of 19
(1,382 Views)

Now, it has label already in LabVIEW NXG 4.

we can find it within item properties pane on the right hand side.

0 Kudos
Message 19 of 19
(1,079 Views)