Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 10 of 10

Thread: How to let users choose the languge of their choice?

  1. #1
    Mike is offline Junior Member
    Join Date
    Nov 2008
    Posts
    10

    Question How to let users choose the languge of their choice?

    I have added a french string.fr-FR.xls file to the string resources directory and imported it accordingly from the admin control panel. My question is now: how to we let the users control which language they want to view?

    Thanks for your help!

  2. #2
    Rex is offline Banned
    Join Date
    Nov 2007
    Posts
    561

    Default

    Give them links to alternate locale versions.
    Example:

    http://my.site.com/default.aspx?localesetting=fr-FR

  3. #3
    Mike is offline Junior Member
    Join Date
    Nov 2008
    Posts
    10

    Default

    Thanks for you help! That will definitely help getting us in the right direction.
    However, upon testing it, I still received the English version of our site.

    1. Import french strings into app. (successful)
    2. Clear cache.
    3. Open http://my.site.com/default.aspx (successfull)
    4. Add localesetting=fr-FR to querystring.
    5. Page refreshes, but still in english.


    Did I miss something? Thanks!

    [Update]
    Some additional information:
    - after clearing all local browser information (cookies, temp files, etc.) changing the language works on the first click. However, subsequent language changes still require two clicks.
    - I have verified that the cookie is properly receiving the value.
    - I have added the localization links in the skin1/template.ascx file.

    Also, I have noticed that once I have entered the shopping cart it is no longer possible to change the language. This appears to be due to the ASPDNSFGUID cookie being set, as once deleted, I am able to translate again.
    Last edited by Mike; 11-11-2008 at 12:55 PM.

  4. #4
    Mike is offline Junior Member
    Join Date
    Nov 2008
    Posts
    10

    Default

    So I managed to get it work *somewhat*.
    What happens now is that I have to click twice on the link with the localesetting to make the language stick.
    My suspicion is that the querystring is is parsed after the locale is set. Is this true?

  5. #5
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    I think a better bet would be to use the (!COUNTRYSELECTLIST!) token.

    From http://manual.aspdotnetstorefront.co...n_tokens.ashx: "Displays a dropdown list of installed locales that customers can use to choose the language to view the site in."

  6. #6
    Mike is offline Junior Member
    Join Date
    Nov 2008
    Posts
    10

    Default

    Scott, thanks for your reply! Is there a way to do this so that instead of a drop-down I can display a list of country flags? If not, I'll go with the drop-down, but flag icons would be preferred.

    Thanks again!

  7. #7
    chrisjob012 is offline Junior Member
    Join Date
    Apr 2009
    Posts
    14

    Default retrieve flags for country

    is it possible to retrieve the flags for each locale?

    regards,
    chris

  8. #8
    DanV's Avatar
    DanV is offline Ursus arctos horribilis
    Join Date
    Apr 2006
    Posts
    1,568

    Default

    You could do this with a bit of custom code, but not out of the box. Another way to handle it I suppose would be hard-code the flag images in your skin, and hard-code the link to the corresponding locale... eg.

    HTML Code:
    <a href="./setlocale.aspx?localesetting=en-US"><img src="./images/usflag.gif"/></a>

  9. #9
    chrisjob012 is offline Junior Member
    Join Date
    Apr 2009
    Posts
    14

    Default

    I dont think there are images of each country in the images folder? am i right?

  10. #10
    MelanieA is offline Junior Member
    Join Date
    Sep 2008
    Posts
    313

    Default

    No there is no certain folder for each country, but you may create if you want. Just make sure the location of your image would be called correctly.

    Ex:

    <a href="./setlocale.aspx?localesetting=en-US"><img src="./images/UnitedStates/usflag.gif"/></a>

    Check if this works for you