Multilingual PNP provisioning for SharePoint Group

Krishna Praveena Chirumamilla 1 Reputation point
2021-01-14T14:25:44.297+00:00

Did anybody try applying localization using PNP Provisioning for SharePoint groups? I have tried but it is not working. Can somebody please help?

<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2015/12/ProvisioningSchema">
    <pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.0.1601.0, Culture=neutral, PublicKeyToken=null" />
    <pnp:Localizations>
        <pnp:Localization LCID="1034" Name="Spanish" ResourceFile="SiteColumns-fr-FR.resx"/>
        <pnp:Localization LCID="1033" Name="English" ResourceFile="SiteColumns-En-EN.resx"/>
    </pnp:Localizations>
    <pnp:Templates ID="CONTAINER-SharePointPalsDemo">
        <pnp:ProvisioningTemplate ID="SharePointPalsDemo" Version="1" xmlns:pnp="http://schemas.dev.office.com/PnP/2015/12/ProvisioningSchema">



            <pnp:SiteFields>


                <Field ID="{793F0419-9A72-48D9-B983-91BD359E5387}" Name="{resource:PNPFieldInternalName}" StaticName="MyCustomPNPField" DisplayName="{resource:PNPFieldDisplayName}" Type="Note" Required="FALSE" RichText="FALSE" Group="My Custom PNP Fields" />

            </pnp:SiteFields>

            <pnp:ContentTypes>

                <!-- Bookmark ContentTypes -->
                <pnp:ContentType ID="0x010500C562BA980E1C457B97298CA27EC2C843" Name="MyCustomContentType" Description="Test Description" Group="Custom Group">
                    <pnp:FieldRefs>
                        <pnp:FieldRef ID="793F0419-9A72-48D9-B983-91BD359E5387" Name="{resource:PNPFieldInternalName}" />
                    </pnp:FieldRefs>
                </pnp:ContentType>

            </pnp:ContentTypes>
            <pnp:Security>

                <pnp:SiteGroups>
                    <pnp:SiteGroup
                        Title="{resource:GroupName}"
                        Description="{resource:GroupName}"
                        Owner="{resource:Owner}"
                        OnlyAllowMembersViewMembership="false">
                        <pnp:Members>
                            <pnp:User Name="{resource:Owner}"></pnp:User>
                        </pnp:Members>

                    </pnp:SiteGroup>
                </pnp:SiteGroups>

                <pnp:Permissions>
                    <pnp:RoleAssignments>
                        <pnp:RoleAssignment Principal="{resource:GroupName}" RoleDefinition="Contribute">
                        </pnp:RoleAssignment>
                    </pnp:RoleAssignments>
                </pnp:Permissions>
            </pnp:Security>


        </pnp:ProvisioningTemplate>
    </pnp:Templates>
</pnp:Provisioning>
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,868 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jerryzy 10,566 Reputation points
    2021-01-15T09:17:50.167+00:00

    Hi @Krishna Praveena Chirumamilla ,

    In the template.xml, needs to add related<pnp:SupportedUILanguages> tag and for the SiteGroup Owner and Members, should use the user login name in resx file like this:

    57152-snipaste-2021-01-15-17-09-32.png

    Here is the compelete template file I used to test and it's working as expected in my side:

    <?xml version="1.0"?>  
    <pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">  
      <pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.28.2012.0, Culture=neutral, PublicKeyToken=5e633289e95c321a" />  
       <pnp:Localizations>  
       <pnp:Localization LCID="1033" Name="English" ResourceFile="SiteColumns-En-EN.resx"/>  
       <pnp:Localization LCID="1034" Name=" Spanish" ResourceFile="SiteColumns-es-es.resx"/>  
      </pnp:Localizations>  
    
      <pnp:Templates ID="CONTAINER-TEMPLATE-B918E3118587463385AE234DF56E8034">  
       <pnp:ProvisioningTemplate ID="TEMPLATE-B918E3118587463385AE234DF56E8034" Version="1" BaseSiteTemplate="GROUP#0" Scope="RootSite">  
          <pnp:SupportedUILanguages>  
            <pnp:SupportedUILanguage LCID="1033" />  
            <pnp:SupportedUILanguage LCID="1034" />  
          </pnp:SupportedUILanguages>  
    
       <pnp:SiteFields xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">  
         <Field ID="{793F0419-9A72-48D9-B983-91BD359E5387}" Name="{resource:PNPFieldInternalName}" StaticName="{resource:PNPFieldStaticName}" DisplayName="{resource:PNPFieldDisplayName}" Type="Note" Required="FALSE" RichText="FALSE" Group="Custom Fields" />  
       </pnp:SiteFields>  
    
      <pnp:Security>  
    
            <pnp:SiteGroups>  
              <pnp:SiteGroup  
                  Title="{resource:GroupName}"  
                  Description="{resource:GroupName}"  
                  Owner="{resource:Owner}"  
                  OnlyAllowMembersViewMembership="false">  
                <pnp:Members>  
                  <pnp:User Name="{resource:Owner}"></pnp:User>  
                </pnp:Members>  
              </pnp:SiteGroup>  
            </pnp:SiteGroups>  
    
            <pnp:Permissions>  
              <pnp:RoleAssignments>  
                <pnp:RoleAssignment Principal="{resource:GroupName}" RoleDefinition="Contribute">  
                </pnp:RoleAssignment>  
              </pnp:RoleAssignments>  
            </pnp:Permissions>  
          </pnp:Security>  
    
        </pnp:ProvisioningTemplate>  
      </pnp:Templates>  
    </pnp:Provisioning>  
    

    Finally, it's necessary to set current logged in user Profile Language to the target language (Spanish 1034 in this thread) in Delve url below:

    https://myaccount.microsoft.com/settingsandprivacy/language

    Wait for a few minutes, the site language will all convert to the target language and the site group set with PnPPrivisioning Template will also apply with the value in SiteColumns-es-es.resx file.

    Reference:

    Provision multilingual sites with PnP templates

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.