SOLVED

Programmatically Enable Multilingual on a Site

%3CLINGO-SUB%20id%3D%22lingo-sub-1453376%22%20slang%3D%22en-US%22%3EProgrammatically%20Enable%20Multilingual%20on%20a%20Site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1453376%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20want%20to%20programmatically%20enable%20Multilingual%20support%20on%20a%20site.%20It%20seems%20like%20when%20I%20set%20Web.IsMultilingual%20%3D%20true%2C%20it%20does%20not%20get%20reflected%20on%20the%20site!%3F%20Translations%20is%20still%20turned%20off.%20If%20I%20turn%20on%26nbsp%3B%20translations%20manually%20and%20then%20set%20Web.AddSupportedUILanguage(1053)%20via%20code%2C%20then%20Swedish%20translation%20is%20enabled.%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20idea%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1455319%22%20slang%3D%22en-US%22%3ERe%3A%20Programmatically%20Enable%20Multilingual%20on%20a%20Site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1455319%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F219437%22%20target%3D%22_blank%22%3E%40Daniel%20Gustafsson%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EWeb.IsMultilingual%20is%20something%20else%20altogether%2C%20a%20relic%20of%20the%20days%20when%20some%20site%20templates%20supported%20MUI%20and%20others%20didn't.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20enable%20the%20new%20Multilingual%20Page%20Publishing%20feature%20on%20a%20site%2C%20you%20have%20to%20add%20feature%26nbsp%3B24611c05-ee19-45da-955f-6602264abaf8%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1466863%22%20slang%3D%22en-US%22%3ERe%3A%20Programmatically%20Enable%20Multilingual%20on%20a%20Site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1466863%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F73026%22%20target%3D%22_blank%22%3E%40Martin%20Laplante%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don%C2%B4t%20know%20what%20happened%20to%20my%20reply%20I%20posted.%20Anyway.%20Thanks.%20that%20worked%20along%20with%20web.AddingSupportedUILanguage(LCID)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOffice%20Dev%20PnP%20are%20using%20the%20web.IsMultilingual%20in%20their%20code%20so%20I%20thought%20that%20flag%20was%20still%20applicable.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi

I want to programmatically enable Multilingual support on a site. It seems like when I set Web.IsMultilingual = true, it does not get reflected on the site!? Translations is still turned off. If I turn on  translations manually and then set Web.AddSupportedUILanguage(1053) via code, then Swedish translation is enabled. 

Any idea? 

2 Replies
best response confirmed by Daniel Gustafsson (New Contributor)
Solution

@Daniel Gustafsson 
Web.IsMultilingual is something else altogether, a relic of the days when some site templates supported MUI and others didn't.

 

To enable the new Multilingual Page Publishing feature on a site, you have to add feature 24611c05-ee19-45da-955f-6602264abaf8

@Martin Laplante 

I don´t know what happened to my reply I posted. Anyway. Thanks. that worked along with web.AddingSupportedUILanguage(LCID)

 

Office Dev PnP are using the web.IsMultilingual in their code so I thought that flag was still applicable.