1
votes

I created a SharePoint hosted app and a new list. But I want to show its list column display name by a resources file. For that I created a new resource from rigth click Feature > Add Feature Resource then the created key is PersonName and the value Person Name. After I wrote in the list schema.xml

<Field ID="{27912FBB-5063-4FF7-9829-B194DDBC7FEB}" Type="Text" Name="PersonName" DisplayName="$Resources:PersonName" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="PersonName" MaxLength="255" />

But the list columns seems to be

$Resources:_FeatureId{54A6CD41-6DB3-45FF-9A2F-D496A13A871F},PersonName;

How can I fix that?

1

1 Answers

0
votes

I am sure pretty late, but I just had the same problem and I figured it out.

What you are probably doing is try to use the resource key inside of the schema.xml of the list.

That is the wrong place to use it. Instead copy the whole line:

<Field ID="{27912FBB-5063-4FF7-9829-B194DDBC7FEB}" Type="Text" Name="PersonName" DisplayName="$Resources:PersonName" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="PersonName" MaxLength="255" />

Inside of the elements.xml of the list where the list definition is. So it should for your example look like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<ListTemplate
    Name="UserList"
    Type="100"
    BaseType="0"
    OnQuickLaunch="TRUE"
    SecurityBits="11"
    Sequence="410"
    DisplayName="UserList"
    Description="My List Definition"
    Image="/_layouts/15/images/itgen.png"/>


  <Field ID="{27912FBB-5063-4FF7-9829-B194DDBC7FEB}" Type="Text" 
         Name="PersonName" DisplayName="$Resources:PersonName" 
         Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" 
         StaticName="PersonName" MaxLength="255" />
</Elements>

If you read carefully this is also documented in the msdn: https://msdn.microsoft.com/en-us/library/office/fp179919.aspx#LocalizingAppWeb

search for the title "To localize the column names of a custom list" and you should find it.