Translating 'ProductName' for product page types

Andrei Vleju asked on February 25, 2020 12:11

Hi all,

I have a problem translating product pages. When a product page is sent for translation, I can see the xlf file with properties waiting to be translated. However in the xlf, I can't see a 'ProductName' property. So when the document comes back translated, and the xlf is imported, 'DocumentName' gets translated and saved into Kentico, but 'ProductName' remains not-translated. So editor will for example, see a german(translated) name in the content tree, but 'ProductName' is still in english (under Form). When he tries to save, the name in the content tree gets reverted to original english version. So the page name gets replaced with 'ProductName' at save time somehow (I can only assume that it happens because 'Page name source field' has 'Use product name' in the page type config).

How can I fix this? (To get product name translated and prevent page name from getting reverted) Do I need to include 'ProductName' in the xlf for translation? If yes, how can I do that?

I checked the CMS.Product type and the field 'ProductName' is already checked as 'Translate field', but still, it's not included in xlf files.

Recent Answers

Brenden Kehren answered on February 25, 2020 22:59

Is the ProductName property a property of the page type or part of the SKU object? If it's part of the SKU object I don't believe those are translated. Only the page type data is sent off to be translated.

Secondly, when you imported all the translations, did you publish the pages? By default the import and processing of translations leaves them in a not published state. So the easiest thing to do is to go to Workflow and select the default workflow and publish the pages from there. Keep in mind, if you had any pages you didn't want published, this will publish them, so you'll have to manually archive them.

0 votesVote for this answer Mark as a Correct answer

Andrei Vleju answered on February 26, 2020 11:16

Thank you for your help Brenden. In my research, the ProductName comes as part of the standard CMS.Product type which (I think) comes by default in the ecommerce module. I'm wondering (new to kentico), isn't there a way to inject ProductName in the xlf so it would also get translated?

0 votesVote for this answer Mark as a Correct answer

Dominic Boyer answered on July 9, 2020 19:47

You have to get the skuID and then get the documentname of that product: Here the node.DocumentName give me the product name in culture and if you have create a product section page type the node.Parent.DocumentName give you the section name in culture. SO in you shopping cart, order and wishlist if you use this structure you can have all the info that you need in every culture

TreeNode node = DocumentHelper.GetDocuments() .PublishedVersion() .Published() .OnSite(siteName) .Culture(currentCulture) .WhereEquals("NodeSKUID", product.SKUID) .FirstOrDefault();

            ViewBag.ProductName = node.DocumentName;
            ViewBag.SectionName = node.Parent.DocumentName;
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.