More in this section

Forums / Developing with Sitefinity / Localization setup

Localization setup

4 posts, 0 answered
  1. Gordon Kennedy
    Gordon Kennedy avatar
    2 posts
    Registered:
    24 Sep 2007
    20 Feb 2008
    Link to this post
    I am currently working to enable localization in our Sitefinity site at www.insights.com.

    The situation is slightly complicated, so I am looking for a little guidance before implementing the localization. Our requirements are as follows:

    • The default language for the site is English

    • The majority of the site will be translated into our other 'core' languages of German, French and Spanish. The exception to this is noted in the next point...

    • We also have regional offices which only have a few pages in the site which will need to be translated. These can be seen at http://www.insights.com/WorldWide.aspx. The text for the pages within this section will be available in English as well as the local language pertaining to the relevant office.

    • The language which appears to the user should be based upon their browser preferences.

    • All body text/images are held in shared generic content modules.

    • There is no immediate requirement for the Sitefinity administration interface to appear in any language other than English.

    What is the best way to set up the web.config to enable the localization to be set up?

    Thank you in advance.

    Gordon Kennedy
  2. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    20 Feb 2008
    Link to this post
    Hi Gordon Kennedy,

    Thank you very much for providing a detailed description of your requirements.
    Basically, if you follow the instructions in the Multilingual Content Management section of the Sitefinity User Manual, you should be able to achieve all these things.
    However, to make things easier for you, I'll list the things you should do below as well; hopefully other users will find this post useful too.

    1. To enable localization for the site, open the application web.config and in section <localization>, set the persistenceMode attribute to either "QueryString" or "PathPrefix" to define the way URLs will be created:

    <localization defaultProvider="Sitefinity"
    persistenceMode="PathPrefix"

    Thus the URLs to the different language versions of the page will look like this:
    http://www.insights.com/en/WorldWide.aspx
    http://www.insights.com/de/WorldWide.aspx

    2. To set English as the default site language and add German, French and Spanish as site languages, change the <localization> section as shown below:

              <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix"
              defaultCulture="en" cultures="en, de, fr, es">

    Please note that once you have set the default site language and started creating content items, you can no longer change it.

    3. Create different language versions of the pages which will contain multilingual content by selecting the page in the sitemap and clicking the language links. For more details, please refer to section Page Localization of the User Manual.

    4. Note that setting the defaultCulture attribute to en does not result in showing the English version of a page first and does not mean that English is always the selected language in the language selector dropdown. This depends on the browser settings: the default language set in the client browser definition overrides the defaultCulture definition in the application web.config. So you won't need to do or set anything else to show the Spanish version to your Spanish users first for example, as long as their browser is set to default to Spanish.

    5. Since you'll rely exclusively on content created with the Sitefinity modules, you'll need to set them as localizable. In the <cmsEngine> section of the application web.config file, set the allowLocalization attribute for the repective provider to true.

    <cmsEngine defaultProvider="Generic_Content">
    <providers>
    <clear/>
    <add name="Generic_Content"
           visible="True"
           defaultMetaField="Name"
           securityProviderName=""
           allowLocalization="True"
           allowVersioning="True"
           allowWorkflow="False"

    Let us know if you need any further information or assistance.

    Best wishes,

    Rebecca
    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center
  3. Gordon Kennedy
    Gordon Kennedy avatar
    2 posts
    Registered:
    24 Sep 2007
    22 Feb 2008
    Link to this post
    Hi Rebecca,

    Thanks for your response. I have now implemented this in our test site and it is working as described.

    There is still a slight issue, however, in that our RadMenu control will only show the pages which are translated to the language set in the browser preferences. Ideally, we would like the menu to still show all of the pages, and default to English if there is no translated version available.

    For example, if we only translate http://www.insights.com/WorldWide/Sweden.aspx and its sub-pages into Swedish, we would still like Swedish visitors to be able to access the rest of our pages in English through the RadMenu bar at the top of the page.

    Is there a way to enable this?

    Thank you again for your help!

    Kind regards,

    Gordon
  4. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    25 Feb 2008
    Link to this post
    Hi Gordon Kennedy,

    Our sitemap provider shows only the pages which have a version for the selected language, so you cannot change this behavior.
    To achieve your goal, you need to implement your own sitemap provider.

    Regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered