PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 6/9/2018 2:30 PM by  Will Strohl
Translation of ADPIP IntegrationResult
 3 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Author Messages





Basic Member






--
5/17/2018 8:28 AM
    Hi

    Does anyone know if there's an easy/integrated way to localize messages returned from an Action Delegate Pipeline Integration Project?

    Regards
    Reto





    Veteran Member






    --
    6/6/2018 10:53 PM
    I haven't tested this, but you should be able to do something like this...

    First, update the GlobalResources.resx file in the App_LocalResources folder of your viewset to include the key and value you wish to display.

    Next, import the following namespace:

    [code=csharp]using Hotcakes.Commerce.Globalization;[/code]

    Finally, you'd call the key and return the value something like this:

    [code=csharp]GlobalLocalization.Localization.GetString("YourKey");[/code]
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes





    Basic Member






    --
    6/8/2018 4:55 AM
    Hi Will

    Thanks for your input. I tested it and it works as you suggested.

    1) In your custom viewset (www\Portals\_default\HotcakesViews\[h]yourViewSet[/h]\Views\App_LocalResources) you create a new entry in GlobalResources.resx and the language dependent versions of it (eg. GlobalResources.de-CH.resx) with a Key of your choice.:
    [code=markup]

    *** MINIMAL ORDER AMOUNT ***

    [/code]

    2) Within the ADPIP Code (eg. in MyCartIntegration.cs) use the Globalization Assembly
    [code=csharp]
    using Hotcakes.Commerce.Globalization;
    [/code]

    3) To read the string from the resource use the key you used in step 1
    [code=csharp]
    var msg = GlobalLocalization.GetString("MinimalOrderAmount.Text");
    [/code]

    This method can also be used to set the minimal amount via the language file.
    If you want these values portal specific and not to be overwritten when updating your Action Delegate Pipeline Integration Project with a new version then you can add a portal specific resource file eg. GlobalResources.de-CH.[h]Portal-0[/h].resx





    Veteran Member






    --
    6/9/2018 2:30 PM
    Awesome! Thanks for posting the complete instructions. Great stuff! :)
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes
    You are not authorized to post a reply.


    Loading
    • Sign-up for the Hotcakes Community Newsletter: