The PointFire Blog
The PointFire Blog
Tips on using SharePoint in a multilingual environment

Why Do We Need PointFire for Multilingual Collaboration in SharePoint? Part III

15.10.13 06:20 AM Comment(s) By Martin Laplante

In parts 1 and 2, we learned the common PointFire techniques to make sure that user interface and content are both in the language of the user's choice.  In part 3, we learn about some of the more advanced and lesser-known techniques, some of them requiring programming skill or access to the file system of the server.

Multilingual Calendar

The first one requires no special access or training.  It consists of use SharePoint's own filtering capabilities.  In Part II we heard about webpart filtering and about list filtering.  List filtering means connecting one of PointFire's language filter webparts (LFWP) to the List View or XSLT List View webpart.  PointFire adds and connects those automatically, but you can also do it manually.  As long as the webpart, even a custom webpart, supports a connection then its content can be automatically filtered according to the user's current language and filtering settings.  This is explained in the appendix to the PointFire 2010 User Guide.

Unfortunately, there are some webparts that don't support a filter connection.  The calendar view is one example.  How do you filter calendar items to only show the ones in the user's language?  The answer is to use a combination of PointFire's webpart filtering and SharePoint's own filtering capability, along with PointFire's multilingual list functionality.

The first step is to make the calendar list multilingual.  Making the list multilingual makes the events view multilingual and adds the “Item Language” column to the Calendar event list.  That means that when a new event is added, you choose whether its language is English or French.  Or both, if you decided to go for the checkboxes (allow multiple selection) option when the list was made multilingual.

Next, go to the page that contains the calendar view of the events, put it in edit mode and add a second instance of the calendar view on the page. Call the two webparts “Calendar” and “Calendrier” to keep track of which is which.  Click the first calendar view webpart, find the Webpart Tools Options ribbon and click on Web Part Properties.  Click on “Edit the current view”.  The changes that you make here only apply to this web part, not to other uses of the current view of the list.  There is no need to give this view a name or change its name.  Scroll down to “Filter”, and in the dropdown select the column name to be “Item Language”, leave “is equal to” and type in “English”.  Click OK.  This copy of the web part will be filtered according to the criteria you just set. 

Return to edit mode, and repeat with the second calendar, only this time Item Language is equal to “French”.  Back to edit mode, in the webpart edit menu of the first calendar, select “Display this webpart in...” then “English”, and in the webpart edit menu of the second calendar, select “Display this webpart in...” then “French”.  

To test, go back to the page in normal mode and add an item whose item language is English and another whose item Language is French.  When you toggle languages, you will only see the events in the currently selected language.

Are the dates still displaying in the wrong language or in the wrong format?  SharePoint's display of dates, numbers, and currency does not depend on the user's language but on the user's regional settings.  PointFire can change regional settings of the user when the user's language changes.  For any given language, there is a choice of regional settings.  Ask your system administrator to set the configuration keys called ManageRegionSettings and DisplayRegions to control which regional settings are used to display dates in the calendar.  Please note, language locale ID and regional locale ID do not necessarily match.  For instance, default English locale ID is US, but the US date format is not used in other English-speaking countries.  Someone who enters a date might accidentally get the month and day reversed if the wrong region locale ID is used.

The other techniques require a little more access.

File system trick

If you have access to the file system, you can place files such as images, css, and javascript into language-sensitive directories.  In most places where PointFire encounters a reference to a URL containing “/_layouts/nnnn/styles/” where nnnn is the localeID of the base language such as 1033 or 1036, it will automatically replace that part of the path with the localeID of the user's currently selected language.  You can use this to your advantage if you need language-sensitive files to loaded.  It's best to use this just for branding style elements and permanent javascript used in master pages.  The directory on the servers where these elements are kept is typically \Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\nnnn\styles\ .

PointFire SDK tags

If you are editing a master page or a page layout file, you can insert some special tags that PointFire will interpret as it parses the SharePoint page.  This post will only discuss two of them, but there are more in the manual.

Code filter


It is possible for PointFire to filter arbitrary html code, not just webparts, by tagging them with the code filter tags.  Consider the following example:

<!--<pointfire:control sectionid="showfrench" language="french" method="remove" />--><a href="http://mylink.ca/french/">
This Link appears in French only.</a><!--<pointfire:control endsection="showfrench" />-->

In the above example, the link would be hidden from all users except those using the site in French.  Conversely, in this example the link would only be shown to users whose language is English

<!--<pointfire:control sectionid="showenglish" language="1033" method="remove" />--><a href="http://mylink.ca/en"glish/>
This Link shows up in English only.</a><!--<pointfire:control endsection="showenglish" />-->

The tag has some replaceable parameters:

sectionid, endsection    Use an identifier that is unique for this page and that matches the one in the endsection tag.


language    Language name or LocaleID for which PointFire should show the code.  In all other languages it will not be shown


method    Either "hide" or "remove".  If "hide" the code will still be there but be in a non-display span.


Language toggle display

This code will display a set of links or buttons to switch from the current language to another supported language.  This is a more convenient alternative to changing the language preference using the option in the Personal Menu.

You can add this to custom layouts/designs by entering the code below in your code in an editor such as SharePoint Designer or in a content editor web part.

Example:

<!--<pointfire:content contentplaceholderid="languagelinks" prefix="<div
><span>Language:</span><br />" body="<a href='{URL}' title='{TITLE}'>{TITLE}</a>" separator=" | " suffix="</div>">-->

There are four replaceable parts to this tag, the prefix, the body, the separator, and the suffix.

The prefix is always generated before and the suffix after the language changing code, provided that there are at least two languages enabled on this site.  Otherwise, no html is generated.

The separator is always generated between the language options provided that there are at least three languages enabled on this site.

The Body is generated for each language except the user's currently selected language.  Within the body are two symbols that will get replaced with a new value for each language for which it iterates.

{URL}  Will be replaced with the appropriate URL for the language switch, typically using a Javascript function.


{TITLE} Will be replaced with the Language name, Ex. “English” or “Français”.

    There is plenty more that PointFire-specific tags can do, but this should get you started.

    Martin Laplante

    Share -