📜 ⬆️ ⬇️

Creating multilingual sites

Sharepoint allows you to quickly and without writing code to create and maintain various localization sites.

Sharepoint has such a concept as Variations - versions of websites in various languages. That is, you can create a website in any language you need, or several websites in different languages ​​through the web interface. At the same time, sites may have the same or different structure, that is, they duplicate each other or may be independent of each other.


In order for this to be possible, it is necessary:
')
1. Install Language Pack for the language you need.
2. Enter the Variations administration page and do something similar to the image below. Create mappings for different languages. At the same time, it is necessary to indicate which of the localizations will be the main one and according to which site template it is necessary to create localized copies of the sites.



After clicking on the “ Create Hierarchies ” button on the portal, nodes will be created for each of the languages ​​you specified.

In order for localization support to be more complete, you can put different logos for versions of websites in different languages ​​into the Style Library in the folder with the language code and start showing different logos depending on the site language.



For example, putting the logo in the folder with the language code, we can add it to the page or master page as follows:

<img src=”<% $SPUrl:~SiteCollection/Style Library/ ~language /logo.gif %>” border=0 />

In this way, it is possible to use on pages and master pages not only images, but also, for example, CSS files:

<SharePoint:CssRegistration name=”<% $SPUrl:~SiteCollection/Style Library/ ~language /Core Styles/Band.css%>” runat=”server”/>

After creating a localized copy of the site, the control for switching between languages ​​will appear in the entire portal in the upper right corner.



It can be modified by creating your control by analogy with standard VariationRootLanding and VariationLabelMenu :



Now imagine that we have controls, master pages, pages, and web parts. How to make them support multilingualism? The answer is simple. We use the invention of ASP.NET, that is, resource files (.resx)



An example of use in the code is as follows:

Label1.Text = Resources.devtraining_event.devtraining_EventContentFieldName;

If you want to use data from resource files in xml files of features and templates of Sharepoint nodes, you can do this as follows:



You need to install the resource files in the 12 \ Resources folder:



This result can be achieved if you try for a long time.



Language Packs can be downloaded here:

MOSS 2007: download (104.1 MB)
WSS 3.0: Download (9.8 MB)

More information on the topic can be found on MSDN:

Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 3 of 3): Creating and Configuring WCM-Enabled Sites
How to: Customize the Variation Root Landing Logic
How to: Customize the Variations Label Control Logic

Source: https://habr.com/ru/post/55436/


All Articles