2015-05-26 38 views
1

我创建了一个SharePoint托管的应用程序和一个新列表。但我想通过资源文件显示其列表显示名称。对于我创建了一个新的资源 从分辩单击功能>添加功能资源然后创建关键是PERSONNAME和值人名。 后,我在列表中写道:schema.xmlSharepoint托管应用程序本地化以列出列表

<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" /> 

不过这个名单列似乎

$资源:_FeatureId {54A6CD41-6DB3-45FF-9A2F-D496A13A871F},PERSONNAME;

我该如何解决这个问题?

回答

0

我相信很晚,但我只是有同样的问题,我想通了。

您可能正在做的是尝试使用列表的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" /> 

列表定义所在列表的elements.xml内部。因此,它应该为你的例子是这样的:

<?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> 

如果你仔细阅读这也记录在MSDN: https://msdn.microsoft.com/en-us/library/office/fp179919.aspx#LocalizingAppWeb

搜索标题为“要本地化的自定义列表的列名”你应该找到它。

相关问题