G
Guest
Hi!
I'm developing components (webparts) for a sharepoint site and are currently
having some problems with the resource manager. The site supports two
languages (English and Swedish) and when the files are published everything
works fine. However, after a few days, suddenly all texts are displayed in
English only!
Below is the code I'm using to read resource files. The project has two
resource files: resources.resx and resources.sv-SE.resx
Does anyone have an idea what may cause this?
Thanks,
Peter
private ResourceManager m_ResourceManager = new
ResourceManager("WebParts.Resources", Assembly.GetExecutingAssembly());
protected string GetString(string Key)
{
ReadLanguageFromUrl();
if (m_CultureInfo == null)
{
string Lang = "";
if (m_Language == Languages.Swedish)
Lang = "sv-SE";
m_CultureInfo = new CultureInfo(Lang);
}
return m_ResourceManager.GetString(Key, m_CultureInfo);
}
private void ReadLanguageFromUrl()
{
if (Page.Request.Path.IndexOf("/en/") != -1)
m_Language = Languages.English;
else
//Default language swedish
m_Language = Languages.Swedish;
}
I'm developing components (webparts) for a sharepoint site and are currently
having some problems with the resource manager. The site supports two
languages (English and Swedish) and when the files are published everything
works fine. However, after a few days, suddenly all texts are displayed in
English only!
Below is the code I'm using to read resource files. The project has two
resource files: resources.resx and resources.sv-SE.resx
Does anyone have an idea what may cause this?
Thanks,
Peter
private ResourceManager m_ResourceManager = new
ResourceManager("WebParts.Resources", Assembly.GetExecutingAssembly());
protected string GetString(string Key)
{
ReadLanguageFromUrl();
if (m_CultureInfo == null)
{
string Lang = "";
if (m_Language == Languages.Swedish)
Lang = "sv-SE";
m_CultureInfo = new CultureInfo(Lang);
}
return m_ResourceManager.GetString(Key, m_CultureInfo);
}
private void ReadLanguageFromUrl()
{
if (Page.Request.Path.IndexOf("/en/") != -1)
m_Language = Languages.English;
else
//Default language swedish
m_Language = Languages.Swedish;
}