OrderDetail

I am trying to change the orderdetail and make it multilanguage. But I can't find where to change it And how do I add multilanguage support to it

Also I have the same problem for the basketsummary, I want to add a picture instead of the text Cart and make it multilanguage. And change the text.

Thanx!

/Andreas



Answer this question

OrderDetail

  • SweptSquash

    Hi Andreas

    Forgive me if I cover things you are already aware of. Firstly you need to make sure that all the pages set the CultureInfo for the current thread. The way I have done things is to create a base page (that inherits from System.Web.UI.Page) and overrides the InitializeCulture event to allow set the culture based on the user's preferences:

    protected override void InitializeCulture()
    {
    // check whether the locale has been specified
    UserObjectProfile userProfile = CurrentUser.GetUserProfile();
    if (userProfile != null)
    {
    Thread.CurrentThread.CurrentUICulture = userProfile.DefaultLanguageInfo;
    Thread.CurrentThread.CurrentCulture = userProfile.DefaultLanguageInfo;
    }

    base.InitializeCulture();
    }

    My version of the InitializeCulture event does a little more than this, but that is the basics.

    Then in the CommerceComponents solution you need to copy the existing resource file (in the Resources folder) then rename it to ComponentResources.sv-SE.resx

    Paul


  • gafferuk

    To explain more in detail, when calling the BasketSummary and OrderDetail I can't make a translation for the text in a resource file connected to the aspx page, either under site.resx or under local resources. So still need help figureing this one out.

    /Andreas


  • PraveenPatel

    Hi Max,

    Yes, sorry for not pointing that out. Have had great help from your blogg earlier around piplines. I am translating the Startersite to Swedish and have managed to make it work except for these to areas. Do I need to rewrite the code and extract the data field by field instead Or is there a faster and better way

    Andreas


  • Lambch0p

    Hi,

    I have used the resource file for the language translations I have made.

    In the masterpage.aspx you have this line can I add a resource to this

    <cc1:BasketSummary ID="ShoppingCart" runat="server" BasketText="View Cart" BasketUrl="~/Cart.aspx"/>

    And change the output text "You have 3 items in your shopping cart totaling 1.169,00 kr. View Cart " and change "View Cart" text to a picture

    And in the ReciptentTemplate and checkout/deafult.aspx you have this line if I add the resource tag,

    <cc1:OrderDetail runat="server" ID="orderDetail"/>

    How do I change the headers and column names in the reource file

    Or should I change it in the database

    /Andreas


  • Kosmo007

    Are you talking abou the Starter Site

    -Max



  • KimberlyL

    The Starter Site uses resource files. Here is an example:

    Open the web.sitemap file and look at the sitenodes. Notice that the title value is being asked is froma resource called Site.resx, that can be found under the App_GlobalResources using the HomeTitle key to retrieve the value.

    <siteMapNode url="~/Default.aspx" resourceKey="Home" title="$resources:Site,HomeTitle" >

    The same is true for other pages just look under the App_LocalResources for each page resource.

    I hope that this points you to the right direction.

    -Max



  • OrderDetail