Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to translate CultureInfo language names

Tags:

I know of three ways to get a full language name of a CultureInfo object.

CultureInfo.DisplayName   
CultureInfo.NativeName  
CultureInfo.EnglishName

DisplayName gives the name in the installed .net language.
NativeName gives the name in 'CultureInfos' language.
EnglishName gives the name in English (surprisingly...)

So for CultureInfo de-DE this gives (on an English .net installation)
German
Deutsch
German

Now my question: Is there a way to ask for the language name of de-DE in another language? E.g. I want the language name of de-DE in Dutch (which would be 'Duits').

like image 814
Yodah Avatar asked Mar 12 '10 12:03

Yodah


People also ask

What is CultureInfo?

The CultureInfo class provides culture-specific information, such as the language, sublanguage, country/region, calendar, and conventions associated with a particular culture. This class also provides access to culture-specific instances of the DateTimeFormatInfo, NumberFormatInfo, CompareInfo, and TextInfo objects.

What is CultureInfo CurrentCulture?

The CultureInfo. CurrentCulture property is a per-thread setting; that is, each thread can have its own culture. You get the culture of the current thread by retrieving the value of the CultureInfo. CurrentCulture property, as the following example illustrates. C# Copy.

How do I change the current culture in C#?

CurrentUICulture = CultureInfo. GetCultureInfo("he-IL"); At run time, ASP.NET uses the resource file that is the best match for the setting of the CurrentUICulture property. The UI culture for the thread is set according to the UI culture of the page.

What is system globalization in C#?

Defines a custom culture that is new or based on another culture and country/region. The custom culture can be installed on a computer and subsequently used by any application that is running on that computer. This class cannot be inherited. CultureInfo.


1 Answers

This functionality isn't built into the .NET Framework

Maybe look at Google Translate API

like image 174
Dead account Avatar answered Oct 09 '22 13:10

Dead account