Some resources of my project aren't translated properly. Wanted behavior is resource displayed in both French and English. Default site's language is English.
When I force my web browser to display content in French it works fine:
but in English it fails:
What is wrong with my code?
CustomWebPartManager manager = new CustomWebPartManager("MSContentEditor.dwp", web);
manager.AddWebPartToPage(welcomePageUrl, "MainZone", 0);
manager.SetWebPartPropertyXml("Content", resM.GetLocalized("searchWelcomeMsg"));
Following is GetLocalized
code:
public string GetLocalized(string strId)
{
return SPUtility.GetLocalizedString("$Resources:" + strId, _resxName, _currentLang);
}
All resources files are deployed (XXXX-SearchCenter.en-US.resx and XXXX-SearchCenter.fr-fr.resx).
Translation only fails in this custom web part and in a custom menu node definition.
0 commentaires:
Enregistrer un commentaire