3

I have an application which has several resource files for different languages depending on the machines culture/language. This works fine if i set the Culture using code, but I am wanting to specify the culture on the command line somehow.

I know in java you simply need to set the VM Args lang attributes and the application starts up in that language, but I am unsure if this is possible using Visual Studio as it doesnt have this type of option.

Can anyone provide a non code solution, I know i could set some cmd line args to read in the lang and then set it using a bit of code but I am wanting to know if there is another way.

I also dont want to keep switching my language using my machine setting.

pengibot
  • 1,492
  • 3
  • 15
  • 35

2 Answers2

1

Cultures are a .NET specific thing, picked up at run-time from the current users 'Locale'. This can be changed by a user at runtime, on a per-application basis.

The default 'Execute Process' functionality does not really support this, a Microsoft utility exists "AppLoc" which adds this functionality. There is an article available on CodeProject Running AppLoc from Batch Files explains how to better control this.

Ray Hayes
  • 14,896
  • 8
  • 53
  • 78
0

Why do you need to set this using cmd line args? You could just use current thread CurrentUICulture property to get it.

Alexander Efimov
  • 2,685
  • 3
  • 18
  • 22
  • I know this. This is what I am currently doing, but I was "wondering" if you could do it using some sort of cmd line args the way that eclipse lets java applications be set. – pengibot Jul 20 '12 at 09:39