Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Localization through resources (.resx) #151

Closed
Muchiachio opened this issue Nov 21, 2015 · 8 comments
Closed

Localization through resources (.resx) #151

Muchiachio opened this issue Nov 21, 2015 · 8 comments

Comments

@Muchiachio
Copy link

It's already rc1, and after a year I'm still unable to get .resx files working 馃槥
Something simple like this

Titles.resx
Titles.fr.resx
public ActionResult Index()
{
    Thread.CurrentThread.CurrentCulture = new CultureInfo("en");
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");

    string name = Titles.Name; // Get default en resource

    Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr");
    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr");

    string name = Titles.Name;  // Get fr resource, but this always return en one...
}

I'm not using any localization packages, because I don't think they are necessary especially in console applications. I even tried

ResourceManager.GetString(string name, CultureInfo culture)

which still doesn't work, I don't get it 馃槙

@hishamco
Copy link
Contributor

Do you have the example in a repo?

@Muchiachio
Copy link
Author

Here's an already deleted repo.
I'm using rc1-final dnx.

@hishamco
Copy link
Contributor

Let me have a quick look ..

@hishamco
Copy link
Contributor

It works fine, it shows Pr茅sent

@hishamco
Copy link
Contributor

capture

@Muchiachio
Copy link
Author

Hehe, you are cheating, I run from VS 馃槂
It works from command line for me too (wow, first time) :o

@Muchiachio
Copy link
Author

This seems to be tracked in a tooling repo already, back to the cave until rc2 hype ;x

@hishamco
Copy link
Contributor

I'm not cheating 馃槃 , if you mentioned before you are ran it in VS, I will tell you, that you should follow the repo tooling

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants