0

So i am not sure if this is possible without using a different method to translate but i will ask anyway as this information might be available somewhere else i am unaware of.

I can change the culture of a webpage and get some .net objects translated for me. For example consider the following:

CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("ja-JP");
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CreateSpecificCulture("ja-JP");
var JapaneseLongDateString = DateTime.Now.ToLongDateString();

This returns "2014年11月12日" - Yeay! :D

But consider this. I have now changed my culture to Japanese. If i then retrieve a culture say for example English (UK). (*NOTE: locale id of English (UK) is 2057)

var ci = new CultureInfo(2057);
var cultureName = ci.DisplayName;

Why does that return "English (United Kingdom)" Should it not return the Japanese for English?

I have also tried to get around this by loading a new AppDomain in a different culture (i thought this might do something different) but the same result occurred.

Thanks in advance, Adrian

Adween
  • 2,792
  • 2
  • 18
  • 20
  • I think this might be a duplicate of [How to translate CultureInfo language names](http://stackoverflow.com/questions/2432813/how-to-translate-cultureinfo-language-names) but I'm not certain enough to close your question. Please take a look, and if it isn't what you're asking, could you clarify in what way your question is different? –  Nov 12 '14 at 10:52
  • @hvd i think it probably might be. i wasn't sure if .net did it... the question is, is that how a Japanese developer would go about getting culture names in their default language... by using google translate? – Adween Nov 12 '14 at 11:05
  • More likely for you, based on how I'm reading your question, would probably be including the translations in your project itself (using localised resource files for the languages you support), not using `DisplayName` at all. Perhaps the answer there wouldn't actually help you all that much. –  Nov 12 '14 at 11:48

0 Answers0