【问题标题】:Sharepoint hosted app localize to list columnsSharepoint 托管应用程序本地化以列出列
【发布时间】:2015-11-04 17:31:36
【问题描述】:

我创建了一个 SharePoint 托管应用程序和一个新列表。但我想通过资源文件显示其列表列显示名称。为此,我创建了一个新资源 从 rigth 点击 Feature > Add Feature Resource 然后创建的键是 PersonName 和值 Person Name。 之后我在列表中写了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" />

但列表列似乎是

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

我该如何解决这个问题?

【问题讨论】:

    标签: sharepoint sharepoint-2013 sharepoint-apps


    【解决方案1】:

    我肯定很晚了,但我也遇到了同样的问题,我想通了。

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

    搜索标题“To localize the column names of a custom list”,你应该会找到它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-24
      • 2018-09-20
      • 1970-01-01
      相关资源
      最近更新 更多