Jump to content

Changing Languages


Recommended Posts

I wrote a fairly simple application for an engineer at my work who passed it on to his customer in Sweden. The problem is that if the region setting on their PC is set up for Sweden all the numbers get messed up. Decimals go away (Sweden uses commas) and some calculations don't work, especially those with exponents. I didn't know this would happen at all, thinking that numbers were pretty much universal.

I know there are users here from Europe which is shy I didn't think about it being a problem. I have not been able to find anything on the message forums about it.

Is there a way to simply change this application from English to Swedish or do they have to live with their PC set to English?

Thanks,

Jack

Link to comment

Manfred,

Thanks for the reply.

Unfortunately it didn't work.

I removed the checkmark in LabVIEW like you said. I then rebooted (just in case) and rebuilt the application into an EXE and the same thing still happens.

I tried a bunch of stuff and noticed that the only thing that matters is the decimal point. If I change the decimal in the Swedish region settings to a period everything works fine. If I leave it a comma it goes wacky again.

Right now I'm changing the region of my development computer to Swedish and and then going to rebuild the EXE to see what happens.

Thanks again.

Jack

Link to comment
Manfred,

Thanks for the reply.

Unfortunately it didn't work.

I removed the checkmark in LabVIEW like you said. I then rebooted (just in case) and rebuilt the application into an EXE and the same thing still happens.

I tried a bunch of stuff and noticed that the only thing that matters is the decimal point. If I change the decimal in the Swedish region settings to a period everything works fine. If I leave it a comma it goes wacky again.

Right now I'm changing the region of my development computer to Swedish and and then going to rebuild the EXE to see what happens.

Thanks again.

Jack

You don't need to rebuild the application to change the decimal setting since it is an application option that is stored in its ini file. The ini key to force the use of the decimal point is:

useLocaleDecimalPt=False

Set it to True and the application will use the local (swedish) comma.

By forcing LabVIEW to use decimal point, that should solve your problem.

However, the best solution is to revise your code so that your application is independant of the local setting for the decimal separator. Use the format specifiers "%.;" (use point) "%,;" (use comma) or "%;" (use system) to force the separator when it is needed, for example reading the numeric reply from an instrument or reading a spreadsheet file.

Link to comment
  • 3 weeks later...

Sorry it took so long to post back but the LabVIEW .ini key does the trick! I sure wish there was more written on what you can put in that .ini file.

The problem with this software was I didn't write most of it, just modified some parts to work with a slightly different configuration than the original software. Whoever wrote it initially took the long way around (looks like they just experimented until they got it to work right) to get most of the stuff done and it was also "proprietary" so I couldn't really do much with it without getting someone upset with me.

I guess without realizing it I have been doing my vi's the way that jpdrolet suggests and have not had any problems.

The majority of the problems I'm called on to "fix" are because someone's software is being used on something it wasn't written for and the engineers think it's easier to just modify that code than it is to write some from scratch.

Thanks again for the help.

Jack

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.