473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get the language value?

Hello,

I know that Thread.CurrentThread.CurrentCulture will get me "en-US",
"en-GB", "fr-FR" and so on ...

I want to get only the language value. I mean the two first letters:
"en" or "fr".

How can I do this?

Thanks,

Miguel

Dec 6 '06 #1
2 1043
Miguel,

Try this:

System.Threading.Thread.CurrentCulture.Parent.Name ()

This returns the Parent cultureInfo object of the current cultureInfo. This
should work for you depending on what you are trying to do. I recommend
reading the following documentation:

http://msdn.microsoft.com/library/de...arenttopic.asp

Let me know how this works out for you.

--
Nick Wegner

"shapper" wrote:
Hello,

I know that Thread.CurrentThread.CurrentCulture will get me "en-US",
"en-GB", "fr-FR" and so on ...

I want to get only the language value. I mean the two first letters:
"en" or "fr".

How can I do this?

Thanks,

Miguel

Dec 7 '06 #2
Miguel I meant this:

System.Threading.Thread.CurrentThread.CurrentCultu re.Parent.Name

--
Nick Wegner

"Nick Wegner" wrote:
Miguel,

Try this:

System.Threading.Thread.CurrentCulture.Parent.Name ()

This returns the Parent cultureInfo object of the current cultureInfo. This
should work for you depending on what you are trying to do. I recommend
reading the following documentation:

http://msdn.microsoft.com/library/de...arenttopic.asp

Let me know how this works out for you.

--
Nick Wegner

"shapper" wrote:
Hello,

I know that Thread.CurrentThread.CurrentCulture will get me "en-US",
"en-GB", "fr-FR" and so on ...

I want to get only the language value. I mean the two first letters:
"en" or "fr".

How can I do this?

Thanks,

Miguel
Dec 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Vincent | last post by:
I would like to develop a site that should be available in several languages, say English, French and German. My question is: how can I suggest browsers of visitors to display the correct language...
19
by: Christian Engström | last post by:
If you have a function that returns something by value, the gcc compiler (version 3.2.3 on Windows XP with MinGW) converts the returned value from the type you specify in the code, to the const...
2
by: OM | last post by:
Hi, I have a simple Access application, for recording fuel use, and generating a few reports. It is necessary that the forms (such as the menu, and data entry forms) be in Thai as well as...
22
by: Michael Nahas | last post by:
Antti & all interested, The draft description of my language to replace C is available at: http://nahas.is-a-geek.com/~mike/MyC.pdf I am a long time C programmer (I read the old testament...
134
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've...
8
by: Metro Sauper | last post by:
Why is the default text representation for booleans in C# 'True' and 'False' whereas in xml it is 'true' and 'false'? It seems like it would make sense to have them both the same. Metro T....
42
by: Eric Gunnerson [MS] | last post by:
You may download the new specification at the C# Developer Center (http://msdn.microsoft.com/vcsharp/language). There is a discussion forum for the C# language on that same page. If you don't...
23
by: Xah Lee | last post by:
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Languageâ€, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
4
by: edgy | last post by:
Hello, I am a beginner with PHP, and I have made a language switcher on a site that I am looking for your feedback on. First of all, the page is http://www.mankar.ca My question regarding...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.