Try our conversational search powered by Generative AI!

Translate blocks on page

Vote:
 

I have a multi-langual site and I want to let the editors to follow the master site and translate whatever content that they need and leave the rest. 

To do that,  I didn't decorate my content area with  [CultureSpecific] attribute. Now if the editors translate any of the blocks, it will show up in the page and if they don't, it will be empty which is fine. 

The problem is that they have to go and find the blocks from the block pane instead of finding the block on the page and translating it. How can I do that?

To elaborate more, lets say that I've setup 2 languages on Alloy demo site and I've created a "StandardPage" (where the ContentArea is not culture-specific).

Now I add a  new block to my page. The block is shown in the content area and I can easily select it and edit it. 

Now I want to translate my page. I go to dansk one, translate the other parts of the page, but I cannot translate the block on the page. I have to go and find that on the blocks tab and then translate the block. Finding the shared blocks (the ones that I used in multiple pages) is even harder.

#176908
Edited, Mar 29, 2017 16:02
Vote:
 

You'll probably need to refine your question with pictures? since it is not answered, i have also hard to understand what the problem is. Regards

#177425
Apr 11, 2017 12:39
Vote:
 

@GOSSO Thanks for the reply. As you've adviced I've tried to clarify my question with adding an image and an example.  Any ideas? 

#177430
Edited, Apr 11, 2017 13:20
Vote:
 

Hi, 

Episerver doesn't support this out of the box. You've to translate all the individual blocks yourself. One thing which can ease your work is Projects.
You can use projects and add all the related items (pages, blocks etc.) and then you'll have track what has been translated/published and what is not. 

#177439
Apr 11, 2017 15:32
Vote:
 

First of all you have to decorate your Property with [CultureSpecific] attribute. Then you wont have the problem with english text on Dansk. 

Then when having [CultureSpecific]  and working in edit with block, you will be asked to translate, click then Translate and fill in the details. 

Also, "For this page" is only good if you only use that block on that page. If you are planing to reuse the block on other pages, make a folder structure in block pane and have them there, then it is easier to find them. 

Good luck!

#177448
Apr 12, 2017 8:05
Vote:
 

Just to clarify my understanding of your issue - you have a page with a content area which isn't culture specific and hence the items in that content area can only be controlled in the master language for that page. When editors go to that page in a language other than the master language they see the content rendered on the page but can't click on the menu in the corner of a block to edit the block.

Unfortunately that's the way the Episerver editor works and so if you want to give editors an easy way to edit the blocks you'll need to write it yourself however it shouldn't be too tricky. Basically you'd need to add something like the following to each of your block partials:

 

@if (EPiServer.Editor.PageEditing.PageIsInEditMode)
{
    var editUrl = string.Format("{0}://{1}{2}#viewsetting=viewlanguage:///{3}&context=epi.cms.contentdata:///{4}", 
        (Request.IsSecureConnection ? "https" : "http"), 
        Request.Url.Host, 
        EPiServer.UriSupport.UIUrl.AbsolutePath, 
        EPiServer.Globalization.ContentLanguage.PreferredCulture, 
        (Model as EPiServer.Core.IContent).ContentLink.ID);
    <a target="_top" href="@editUrl" style="display: inline-block; background: #000; color: #fff; padding: 5px; text-decoration: none; position:absolute; top: 0; right: 0;">Edit</a>
}

You could manually add that code but it would probably make sense to add something to your ContentAreaRenderer to automatically add it when rendering the blocks out.

Hope that helps!

#177487
Apr 12, 2017 18:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.