Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

How to translate groupnames with spaces?

Vote:
0

How do i translate my groupname here?

[Display(Name = "Body", GroupName = "Main Body", Order = 400)]
		public virtual XhtmlString Content{ get; set; }

I cant have spaces in my xml like this:

<groups>
    <Main Body> Content</Main Body>
</groups>

Is there a solution to this?

#206994
Edited, Sep 06, 2019 10:16
Vote:
1

I am guessing that you can't have spaces due to the W3C XML specification which strictly defines the syntax of names. 

#206997
Sep 06, 2019 10:49
Vote:
0

Building on Maris answer, you should just remove the space:

[Display(Name = "Body", GroupName = "MainBody", Order = 400)]
public virtual XhtmlString Content{ get; set; }

Then you can translate it easily:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<languages>
    <language name="English" id="en">
        <groups>
            <mainbody>Content</mainbody>
        </groups>
    </language>
</languages>

Episerver already has a tab called content already, so you'll end up with 2 called that. You can use that one with EPiServer.DataAbstraction.SystemTabNames.Information.

#207036
Sep 06, 2019 16:03
* 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.