The magic of MUI: a deep dive and outside of the box story

A few weeks ago I almost never heard of MUI, but since I had to do a project that needed to be multilingual in every facet of the word multi I had to deep dive very fast.

Well at the moment that I’m writing this article I’m on the train home and we’ve just done our first demo to the client and it worked flawlessly (after my colleague set his profile to the correct languages that is).

First off, a few questions:
First, can you change the field names that are displayed in the lists and in the forms on the fly by just setting your language profile wise?
Second, is it possible to even change the language of the items that are displayed (for example in a dropdown list) to that profile language?

Answer is yes to both questions. But ok, for the second a lot more effort is needed.

First, think resource files, this will help you a long way.

The key of the MUI is resource files and LCID…… L what?
LCID, language code identity, it’s an integer value that represents each language.
For example 1043 is Dutch, 1036 is French and so on. For a complete chart of all the language codes (link)

Why do you need MUI?
If you are implementing a solution on a single language site and you are sure that you never have to take another language into account you don’t need MUI.
From the moment you are installing language packs than it is maybe time to think about it.
Because how are you going to multilingual your solution (taking into account that your solution is being used by other language speaking people of course).

What can be MUI’fied?
Pretty much can be changed: list names, field names, even the values in the fields (although custom forms are needed here) and your visual webpart. Besides all the standard SharePoint fields and with the use even content can be translated.
Below is a complete list

But what if you don’t want to use variations?
Well than it is possible too, all the examples that I’ve found on the net only gave a high level feeling about MUI. Almost never a way is shown on how to translate your webpart or even content in the webpart.

I’ll give a small example that you can use as a template.

    1. Create an empty SharePoint project (farm level)
    2. Next create a mapped folder to {sharePointroot}resources

      a. First you have to create a resource file in this directory that is just “name.resx” (no language addition needed)
      b. Next comes the language dependent files , for example “name.lowercase-uppercase.resx “ = “name.nl-NL.resx” (the language part is better known as the lcid string, for more Local codes )
      c. Do this for each language that you wish to support
      d. In all the resource files set a FeatureTitle and FeatureDescription key (value you can choose, but make a clear difference between the languages)

    3. Add a feature
    a. set as title: $Resources:FeatureTitle;
    b. set as description: $Resources:FeatureDiscription;
    c. and in the properties of the feature set “Default Resource file” to “name”

    d. this is what it should look like

    4. Now deploy

      a. If there are language packs installed on the server than you’ll get an option in the site collection settings under the heading “Site Administration” named “language settings”

        i. Check all the languages



      b. Your user menu in the upper right corner will now get an additional language setting option

      c. If you go to your site collection feature (or site features depending on the scope) and you will see your feature with the correct name in the language selected, change the language to another one and you’ll see that it changes with it

Congrats , you’ve now done your first MUI not out of the box 😀

In my second blog post (probably over a few days), I’ll go even deeper and explain which LCID you must retrieve in order to handle the language changes correctly (hint: there is a sneak preview in my resources part at the footer of the blog post.

For explanation about MUI : Jopx multilingual user interface mui
Resources:
printscreens
MUI in SP 2010

For more info about the SPWeb.language vs the cultureInfo please go to this site
sharepoint baker

Leave a Reply

Your email address will not be published. Required fields are marked *