More in this section

Forums / Developing with Sitefinity / Localization cultures

Localization cultures

11 posts, 0 answered
  1. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    06 Feb 2008
    Link to this post
    Hello,

    Sitefinity does not seem to distinguish specific localization cultures; for example: I've added "en-GB, en-US, de-DE, de-AT" into localization cultures attribute but sitefinity only recognizes these as just two unique cultures - english and german.

    Is this intended? If so, how can one implement localized content for such cultures?
  2. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    07 Feb 2008
    Link to this post

    Hello,

    I'll explain this in more detail.

    I need to create a web site that targets different countries. Some content will be shared and some will be specific for each country. I need to localize content for countries that use the same language (for example: Germany, Austria, Switzerland). Using Sitefinity's built-in localization system seems like an excellent way of achieving this, but here's a problem:

    I tried doing this in Sitefinity's web.config:

    <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="hr-HR" cultures="hr-HR, de-DE, de-AT, de-CH">

    For some reason, Sitefinity seems to convert these specific cultures into neutral cultures - instead of getting Deutsch(Germany), Deutsch(Austria) and Deutsch(Switzerland), I just get a single Deutsch as available culture.

    So, how do I get Sitefinity to work with CultureInfo.GetCultures(CultureTypes.SpecificCultures), instead of CultureInfo.GetCultures(CultureTypes.NeutralCultures)?

    Thanks.

  3. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    07 Feb 2008
    Link to this post
    Hello Sasa,

    Actually, you have to do a slight modification to allow specific localizations for your website.

    In the web.config file, you have to find this line : 
        <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" 
        defaultCulture="en" cultures="en,es, fr, de, bg"

    and add the following code : 
    allowSpecificCultures="True" 


    The result should look like this :

    <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix"   
    defaultCulture="en" allowSpecificCultures="True" cultures="en,es, fr, de, bg"
     
    Now, Sitefinity will be able to work with specific localizations such as en-US and en-GB, for example.

    Please, let me know if everything is works out correctly after the modification. Thank you.


    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Sasa
    Sasa avatar
    17 posts
    Registered:
    24 Aug 2007
    07 Feb 2008
    Link to this post
    Yes, I've stumbled on this post (http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bbahmg.aspx) in the meantime.

    It suggests that this will break generic content, news, and other modules. Is this still the case?

    -------------------------------

    I tried this. It seemed to have worked. Though I experienced some weird behaviors:
    Initially I've set default culture to croatian ("hr"); now that I've changed it to hr-HR (using specific cultures is simply future-proof way for doing anything related to multilanguage functionality). Well, now when I add a new page it seems to be created as "hr", instead of "hr-HR". How do I fix this?

    Another thing:
    When I visit a page containing multilingual generic content that hasn't been translated to current language, is there a way to not display the default culture translation - i'd rather redirect to home page?
    It's the same with news (I'v posted relating to that problem: http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bcagcg.aspx)

    Thanks.
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    11 Feb 2008
    Link to this post
    Hi Sasa,

    First of all, let me remind that changing the default culture for the site after pages and content items have been created is not a good idea, as this may lead to many unexpected problems.

    Please note that when you create a page, it's being created in the culture that was last used. If you log in, and haven't created any pages yet, the pages will be created in your default culture. That's why, if you have previously worked with an "hr" page and try to create a page immediately after that, the page will be created in "hr".

    Therefore, a good practice is to create all the necessary pages in the default culture, and after that to create the pages in other cultures.

    Check our forums also, for information about your other questions. 
    http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bcagcg.aspx

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. anand
    anand avatar
    59 posts
    Registered:
    11 Jun 2008
    20 Dec 2008
    Link to this post

    I have following questions. Please give me answer.

    1) I have made English (United Kingdom) as a default language so I have added following changes in web.config.

    <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="en-GB" cultures="en-US, da, es, bg" allowSpecificCultures="True">

    but in admin section, I am seeing “English” as first (default) language, can we show English (United Kingdom) as first (Default) in language selector control in admin and user section?

    2) How can we change language name in language selector dropdown?
    Like English (United Kingdom)
    à English (British), please explain

    3) can you please provide us list of all supported language and their country codes in Sitefinity localization feature?

    4) In addition to above localization we also want to add new locations of Guangzhou, Changsha, Beijing, Shanghai , Macau, Hong Kong, Zhuhai, Xiamen, Chengdu, Xian, Hangzhou, Qingdao and Dalian.
    Please country code for that. Can you please provide us their country code?

    5) How can we add 2 separate Chinese options (essentially one will be traditional characters while the other will be simplified characters or what they refer to as Beijing/government Chinese). Can you please provide us their country code?



  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Dec 2008
    Link to this post
    Hello Anand,

    1. Please add the en-GB culture to the cultures collection. Your default language should exist in this collection.
    2. The language names are taken from .NET framework localization settings. You can build your own control for that purpose. We have a solution for flag list control in the forums - you can run a search about it.
    3, 4 and 5: Again, Sitefinity supports all languages that are presented in the .NET Cultures. Please refer to MSDN CultureInfo - Localization and Globalization for a list with the supported languages. You can also create your own culture.

    I hope this helps.

    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. anand
    anand avatar
    59 posts
    Registered:
    11 Jun 2008
    22 Dec 2008
    Link to this post

    1) I have added en-GB (my default culture) in culture collection in web.config.

    <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="en-GB" cultures="en-GB, en-US, da, es, bg" allowSpecificCultures="True">

    but still I have "English"  as a first language in language selector control in admin section as well as in user section,
    According to me it should be "English (United Kingdom)" as first language in language selector control (not English)

    2) Can you please give me reference, how can we create our own control so that we can change language name in language selector control (I am facing problem how can we pick country code from web.config cultures collection)

  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    23 Dec 2008
    Link to this post
    Hi Anand,

    1. We saw this behavior and just fixed it for the upcoming release. Starting from Sitefinity 3.6 you will no longer experience this. You should select the desired language in the meantime.
    2. Please refer to How To Read web.config sections article.

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Ritu
    Ritu avatar
    4 posts
    Registered:
    25 Jul 2007
    28 Jan 2009
    Link to this post
    Hello,

    I have a similar problem. My site is based for three different countries.
    1) AU
    2) UK
    3) US

    My web.config localisation code is -

    <localization defaultProvider="Sitefinity"  allowSpecificCultures="True" persistenceMode="PathPrefix" defaultCulture="en-AU" cultures="en-AU, en-US, en-GB">
                <providers>
                    <clear/>
                    <add name="Sitefinity" type="Telerik.Localization.Data.DefaultProvider, Telerik.Localization.Data" connectionStringName="DefaultConnection"/>
                </providers>
            </localization>

    When i go to www.test.com.au, it works fine and navigates to www.test.com.au/en-au/Home.aspx.

    The problem lies when it goes to either US or UK.
    If i start with www.test.eu it goes to the correct culture /en-GB/Home.aspx,
    now from this page if i navigate to the US site, it goes to www.test.us/en-GB/Home.aspx.
    However, if i close the browser and then go directly to www.test.us, it goes to the correct culture /en-US/. But his time if i navigate to the UK site from here,
    it incorrectly goes to www.test.eu/en-US/Home.aspx.

    In both the cases, the AU version works fine.

    Please help.
  11. Ritu
    Ritu avatar
    4 posts
    Registered:
    25 Jul 2007
    28 Jan 2009
    Link to this post
    Hello,

    This is has been solved. It was a problem in the IIS setup of the site.
Register for webinar
11 posts, 0 answered