A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

How to chnage property name langauge wise

Vote:
 

Hi ,

I have to change property Display name by  page's langauge wise (culture wise). when i hit english langauge page, it will display lable as "Youtube URL or ID" , when i hit the China langauge page it will display lable as "Youku URL or ID".

I tried it by putting my property value in Resource file but it is considering user langauge.

Anyone please help me , how can i achive this?

see my below code. 

[CultureSpecific]
[Display(Name = "Video (YouTube/Youku Url or ID)", Order = 50)]
[BackingType(typeof(PropertyString))]
[UIHint(UiHints.WideTextBox)]
public virtual string Video { get; set; }


     
       
           
               
                       
                            Youtube Video

              

                   


       

   
       
           
               
                       
                            Youku Video

              

                   


       


     
             

Thanks in Advance !





#198654
Nov 02, 2018 9:05
Vote:
 

Property definition:

[Display(
    GroupName = SystemTabNames.Content,
    Order = 50)]
[CultureSpecific]
[BackingType(typeof(PropertyString))]
[UIHint(UiHints.WideTextBox)]
public virtual string Video { get; set; }

contentTypes_en.xml:

<?xml version="1.0" encoding="utf-8"?>
<languages>
  <language name="English" id="en">
    <contenttypes>
      <icontentdata>
        <properties>
          <Video>
            <caption>Youtube URL or ID</caption>
            <help>...</help>
          </Video>
        </properties>
      </icontentdata>
    </contenttypes>
  </language>
</languages>

contentTypes_zh.xml:

<?xml version="1.0" encoding="utf-8"?>
<languages>
  <language name="Chinese" id="zh">
    <contenttypes>
      <icontentdata>
        <properties>
          <Video>
            <caption>Youku URL or ID</caption>
            <help>...</help>
          </Video>
        </properties>
      </icontentdata>
    </contenttypes>
  </language>
</languages>
#198659
Nov 02, 2018 9:56
Vote:
 

Hi Dejan Caric,

How can i call contentTypes_en.xml and contentTypes_zh.xml by culture wise , say when i hit the URL www.xyz.com/en-gb then contentTypes_en.xml will be called and when i hit the URL www.xyz.com/ch-zh then contentTypes_zh.xml  will be called?

Thanks !

#198661
Nov 02, 2018 10:19
Vote:
 

contentTypes_en.xml and contentTypes_zh.xml will localize properties in edit mode based on the personal language you selected under My Settings section.



If you selected Chinese as a personal language, but you're editing a page in the English branch, property names will be displayed in Chinese.

#198665
Nov 02, 2018 10:39
* 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.