With the continually growing fan base (and purchasers of course) of our Bamboo products, we realized that many of our customers have the need to display their SharePoint deployment in different languages. In response to this growing demand, Bamboo has provided the means to modify the text in both Web Parts and the Web Part Properties Tool Pane to display a different language.
In this posting we will discuss where the Language files exist, how to update them and how to set the Web Part to use them.
To locate the language files, navigate to C:\inetpub\wwwroot\wss\virtualdirectories\ on your SharePoint front end Web server. If you are not entirely familiar with this directory, this is where your Web Application web files reside. Each directory within VirtualDirectories map to a Web Application, commonly labeled the same as the port of the given Web Application. After you located the appropriate Web Application directory, expand to locate a sub directory called wpresources. WPResources contains resource files necessary for various Web Parts to function such as image files, user interface layout files, and in our case language files. Each Web Part has their own Resource folder. All Bamboo resource folders start with the name Bamboo followed by the Web Part name, for example for List Rollup Web Part, its resource folder is called Bamboo.ListRollup.WebPart.
After you locate the resource folder of the Web Part of your choosing, you will notice various files within the folder. You will want to locate specifically a set of files with an extension of .XML. Commonly included with each Web Part is a set of 4 files:
*Note - Even though we include all 4 of these language files, the majority are simply placeholders for future translations and mimic the 1033.English.xml.
When you open one of the language files, notice the XML format. In case you are not familiar with XML, let me provide you with a quick overview of things to know. XML files are built using what is called Opening and Closing tags. Each "set" of tags decipher a different setting for the program to read. A given set of tags are defined by the name of the opening and closing tag. For example and opening tag could be <Date> as a result, the closing tag always matches the opening tag name with the addition of a /, ie: </Date>. Between opening and closing tag sets could be either text to define a value for that setting or an additional set of tags. You can also provide comments within XML files to help provide organization and notes. To signify the beginning of a comment, use the following comment opening tag <!--. To close the comment, use the comment closing tag -->. Any text between these two tags will be ignored by the program.
Now that I've explained how XML files work, let's discuss the Web Part language files. Within a Bamboo language file, you will notice a set of comment lines that help organize the file, commonly in 3 sections: Web Part Labels are labels that are found in the actual Web Part interface to the end user; Tool Part Labels are labels that are found in the Web Part Tool Pane where you configure the Web Part; and lastly, Custom Resource Messages are messages returned to the user from either the Web Part or Web Part Tool Pane.
Within each of the abovementioned sections reside several sets of tags. Each set of tags defines a different string of text found in the given Web Part. For example, Bamboo List Rollup Web Part has the following section of user interface:
Notice that the following strings exist in the above Web Part segment example:
Click arrow button to populate List and View drop-down selection.
Get View Query
Now viewing the 1033.English.XML for Bamboo List Rollup Web Part, the following sets of tags define the above strings of text -
<resource id="SelectList">Select lists:</resource>
<resource id="SiteDes">Click arrow button to populate List and View drop-down selection.</resource>
<resource id="CamlQuery">CAML Query:</resource>
<resource id="GetViewQuery">Get View Query</resource>
<resource id="ShowHelp">Show Help</resource>
Notice that in the above example, I have color-coded the tags to help identify the text that can be modified. Between the red tags is the text that is displayed in the Web Part. So for example, if I were to modify the above sample set of tags and add the text (Blog Example) -
<resource id="SelectList">Select lists (Blog Example):</resource>
<resource id="Site">Site (Blog Example):</resource>
<resource id="SiteDes">Click arrow button to populate List and View drop-down selection (Blog Example).</resource>
<resource id="ListName">List (Blog Example):</resource>
<resource id="ViewName">Views (Blog Example):</resource>
<resource id="CamlQuery">CAML Query (Blog Example):</resource>
<resource id="GetViewQuery">Get View Query (Blog Example)</resource>
<resource id="ShowHelp">Show Help (Blog Example)</resource>
The List Rollup Web Part sample interface will show a different set of strings with the modified translation file.
Now that I have introduced you to the translation files and how to update them, let's talk about how to set the newly updated file to the Web Part instance of your choice. To achieve this is very simple. First, navigate to the Web Part instance of your choosing. Next, open the Web Part Tool Pane and expand Bamboo Properties section. Here you will see a setting called Select a language with a drop down menu associated. This drop down menu will display all XML files found in the associated Web Part resource directory found in wpresources.
By default the 1033.English translation file is selected. One of the great advantages to the translation files is the ability to translate the Web Part Tool Pane. As mentioned, by default the 1033.English file is selected when a new instance of the Web Part is deployed. However, if you would prefer to have a different translation file selected when a new instance of the Web Part is added to the page, this is easily done.
- Add a new instance of the Web Part to a Web Part Page.
- Open the Web Part Tool Pane and set the Select a language to the file of choosing and leave all the other settings as is.
- Export the Web Part to your local machine. This is found in the same edit menu as the Modify Shared Web Part. This will save a file with an extension of .dwp.
- Now go to the SharePoint front end Web Server, and navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
- Locate the appropriate Web Part folder, this matches the same name as you found in the wpresources directory.
- Within the Web Part directory a folder exists called WebParts. Replace the DWP within this folder with the newly exported Web Part file.
As a result, any future instances of the Web Part added to the page will have the appropriate translation file selected by default.
Jul 07 2008, 01:15 PM