How to create a module in a website with 3 front-end languages?
My resources are defined as the following:
<cultures> <clear /> <add culture="en-US" uiCulture="en" key="english-en-us" /> <add culture="pt-BR" uiCulture="pt" key="portuguese-pt-br" /> <add culture="es-ES" uiCulture="es" key="spanish-es-es" /></cultures><backendCultures> <clear /> <add culture="en-US" uiCulture="en" key="english-en-us" /></backendCultures>sf.DocumentLibrary().CreateNew().Do(lib => lib.Title = ModuleName; // ERROR
lib.UrlName = ModuleName;);Unsupported language "pt-BR". If you want to support this language, please configure your application accordingly.System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");moduleNode.AvailableLanguagesHello Bruno Michels,
This has been logged as a bug. It is related to a problem that in multilingual mode Sitefinity doesn't set correctly the current UI culture during the installation of Modules.
As a workaround i propose to change the beginning of your module install method like this:
public override void Install(SiteInitializer initializer)
base.Install(initializer); if (Config.Get<ResourcesConfig>().Multilingual) System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo (Config.Get<ResourcesConfig>().DefaultBackendCulture.UICulture);