0

Honestly this is first time into resx files for me. I try to investigate what bad and good practice and finds that there exist as much ideas as lines for someone soon to translate.

As whole I got into this idea,

  1. Create all "Resources/Purpose.lang-COUNTRY.resx" as needed
  2. Create a singleton that loads currentculture and hook corresponding resx file.
  3. Whenever needed, use SingletonName.GetString("StringVariable");

    • How about using Singleton here?
    • Yes/no what's better practice?

I'm also a little confused of how to find correct name to refer the embedded resx.

ResourceManager rm = 
  new ResourceManager("SomeLang.en-US", Assembly.GetExecutingAssembly());

It searches for a .resource (the files are named resx) and I can't find the resource specification in dll through reflector..

Independent
  • 2,924
  • 7
  • 29
  • 45
  • Whats the question then? – Andrew Mar 23 '11 at 22:39
  • Are you using .NET MVC or Web forms? I have a nice simple example of one approach in MVC3? – Andrew Mar 23 '11 at 22:51
  • This should be pure c# usage (business/data logic). There are other solutions needed when embedding resources into ASP / MVC3 controls, i know so - but will come into that later on. – Independent Mar 23 '11 at 22:56

1 Answers1

0

I found a fairly straight forward approach for internationalization in ASP.NET MVC3 that I thought may give you a different angle to consider / compare your current approach with.

http://afana.me/post/aspnet-mvc-internationalization.aspx

Andrew
  • 9,967
  • 10
  • 64
  • 103
  • Thank's. Your probably right about it. But I will tell, as a comment, that your proposed answer is not even close to what I ask for, however it might be a good (complex though) solution to a MVC layer later on. – Independent Mar 28 '11 at 19:12
  • I knew it didn't anwser directly but thought it may help. I am working on something similar at the moment so I will update with any extra information :) – Andrew Mar 28 '11 at 19:19