Translation in Orchard WebSite

Apr 11, 2013 at 5:23 PM
Hello,
I installed the Magelia Orchard module
I would like to have the views localized in French in my Orchard WebSite.
I manage to add the Countries widget but i don't find an equivalent for the languages.
Do i have to change this in the Magelia's backoffice or in the Orchard settings ?
Maybe the module needs the localization .po files ?
Thanks for your answer =)
Coordinator
Apr 11, 2013 at 5:54 PM
Hi Jules,
Thx for your question and for your interest in Magelia WebStore. Please proceed as follows :
  1. In Orchard > settings : define french culture as default Site culture
  2. localize po files to get the orchard view information rendered by orchard localized in French
  3. Configure the french culture in Magelia WebStore (you probably did that already)
  4. Contribute product info in French in Magelia WebStore
  5. Do not forget to configure all other required options : tax, shipping, inventory, price, etc.
  6. When you are done do not forget to use the Products > data update feature to make sure that all changes you made will be available for the front office.
There is an orchard config guide available from this page of our website http://www.magelia.org/resources/module-for-orchard/introduction

Best regards,

Yves-Alain
Apr 12, 2013 at 10:46 AM
Hi Yves-Alain,
  1. In Orchard > settings : I have defined French culture as default site culture.
  2. I have configured the French culture in Magelia WebStore.
    To be sure that my culture is French in Magelia backoffice i have deleted the English culture (to have just the French culture).
  3. I have contributed product info in French in Magelia WebStore.
  4. I have configured all other required options : tax, shipping, inventory, price, etc.
  5. I already used the Products > data update feature.
But there are no translation for :
  • "Basket".
  • The different items of a Product list like "Name", "Price", "Add to cart", "View detail".
  • "Currency".
  • "Country".
  • All items of an article in the Basket...
  • ...
I have started to make the .po files for Magelia's module but I can't localize these informations in views like Basket.cshtml (or checkout.cshtml...) because data are populated by Magelia services directly :
<div class="mag-basket"
     data-config='
        {
            "getBasketUrl":"@Url.Action("GetBasket", new { controller = "Basket", area = "Magelia.WebStore", basketPartId = this.Model.BasketPartId })",
            "updateBasketUrl":"@Url.Action("UpdateBasket", new { controller = "Basket", area = "Magelia.WebStore", basketPartId = this.Model.BasketPartId })",
            ...
        }
     '
>
Apr 12, 2013 at 4:06 PM
Edited Apr 12, 2013 at 4:45 PM
I have localized the .po files, i have found how to translate the information which was in the EditorTemplate folder...
There are just some issues when i translate a word with an accent when this word is used in javascript.
If I put a & eacute; (for example) : he isn't translate, if i leave the character with accent, the result is �.
I have put character without accent for the moment.

I have found some little issues :

1) To translate these parts :

File : ~/Modules/Magelia.WebStore/Views/Parts/ProductList.cshtml
Line : 94
old : @(GetSortLink("Name", "Name"))
new : @(GetSortLink("Name", T("Name").ToString()))

File : ~/Modules/Magelia.WebStore/Views/Parts/ProductList.cshtml
Line : 97
old : @(GetSortLink("ShortDescription", "Description"))
new : @(GetSortLink("ShortDescription", T("Description").ToString()))

File : ~/Modules/Magelia.WebStore/Views/Parts/ProductList.cshtml
Line : 100
old : @(GetSortLink("PriceWithLowerQuantity.SalePriceIncludingDiscountAndTaxes", "Price"))
new : @(GetSortLink("PriceWithLowerQuantity.SalePriceIncludingDiscountAndTaxes", T("Price").ToString()))

Fichier : ~/Modules/Magelia.WebStore/Views/Parts/UserOrders.cshtml
Ligne : 55
old : @GetOrdersLink("Creation date", "CreationDate")
new : @GetOrdersLink(T("Creation date").ToString(), "CreationDate")

Fichier : ~/Modules/Magelia.WebStore/Views/Parts/UserOrders.cshtml
Ligne : 58
old : @GetOrdersLink("Status", "Status")
new : @GetOrdersLink(T("Status").ToString(), "Status")

Fichier : ~/Modules/Magelia.WebStore/Views/Parts/UserOrders.cshtml
Ligne : 61
old : @GetOrdersLink("Total", "OrderTotalIncludingDiscount")
new : @GetOrdersLink(T("Total").ToString(), "OrderTotalIncludingDiscount")

Fichier : ~/Modules/Magelia.WebStore/Views/Parts/UserOrders.cshtml
Ligne : 64
old : @GetOrdersLink("Total including taxes", "OrderTotalIncludingTotalDiscountAndTaxes")
new : @GetOrdersLink(T("Total including taxes").ToString(), "OrderTotalIncludingTotalDiscountAndTaxes")

2) Typos :

File : ~/Modules/Magelia.WebStore/Views/AddToBasket.cshtml
Line : 11
old : "successMessage":"@T("Product successfuly added to cart, added quantity : {addedQuantity}, total quantity : {totalQuantity}")",
new : "successMessage":"@T("Product successfully added to cart, added quantity : {addedQuantity}, total quantity : {totalQuantity}")",

File : ~/Modules/Magelia.WebStore/Views/AddToBasket.cshtml
Line : 12
old : "partialMessage":"@T("Product partialy added to cart, added quantity : {addedQuantity}, total quantity : {totalQuantity}")",
new : "partialMessage":"@T("Product partially added to cart, added quantity : {addedQuantity}, total quantity : {totalQuantity}")",
Coordinator
Apr 12, 2013 at 4:54 PM
Hi,

Nice to heard that you finally find a solution :-)

For the encoding problem, it seems to be related with Orchard. Could you verify that the .po file is saved using UTF-8 encoding ? If the issue is still present, let's have a look with fiddler, maybe it will give you tips on how to resolve the encoding issue.

Thanks for the typos, we will integrate this in the next release.

Regards,

Cyril DURAND