code_junkie

Localization with SharpDevelop

Nov 12th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // load the resource file once
  2. resourceManager = ResourceManager.CreateFileBasedResourceManager(file, filePath, null);
  3.  
  4. // depending on user selection, I set the CultureInfo in the code behind the form, i.e.
  5. Thread.CurrentThread.CurrentUICulture = locales[0]; // which contains "en"
  6.  
  7. // and that's the method of the same class used to lookup the values
  8. public string getValue ( string key )
  9. {
  10. return resourceManager.GetString(key);
  11. }
Add Comment
Please, Sign In to add comment