在 EPiServer 文件管理器中本地化 XForms

发布于 2024-09-11 23:52:02 字数 624 浏览 0 评论 0原文

在 EPiServer 文件上传对话框中,有一个部分用于向上传的文件添加元数据,例如标题、链接、描述、作者和发布者。这些表单字段使用 XForms 实现并在 FileSummary.config 中配置。

这些字段的标题直接在包含 XForms 控件的 HTML 标记中定义,如下面的代码片段所示。

<tr>
    <td class="EP-tableCaptionCell">
     <span id="id_field1">Author</span>
    </td>
    <td valign="top" width="200" height="10">
     <xforms:input ref="Author" value="" id="id_field2" size="40" class="commonInput" />
    </td>
</tr>

我的问题是,如何本地化这些字段标题?在这种情况下,它将是作者。

在从 lang xml 文件驱动的文件管理器的每个其他部分中,本地化都以日语进行工作,但文件管理器的这一部分的工作方式似乎与 Episerver 管理和编辑的其余部分完全不同。

In the EPiServer file upload dialogue, there is a section for adding meta data to an uploaded file such as Title, Link, Description, Author and Publisher. These form fields are implemented using XForms and configured in FileSummary.config.

The headings for these fields are defined directly in HTML markup containing the XForms controls as in the snippet below.

<tr>
    <td class="EP-tableCaptionCell">
     <span id="id_field1">Author</span>
    </td>
    <td valign="top" width="200" height="10">
     <xforms:input ref="Author" value="" id="id_field2" size="40" class="commonInput" />
    </td>
</tr>

My question is, how can I localise these field captions? In this case it would be Author.

The localisation is working in Japanese in every other section of the file manager driven from the lang xml file, but it seems this part of the file manager works in a totally different way from the rest of the episerver admin and edit.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦一生花开无言 2024-09-18 23:52:02

EPiServer CMS 功能 XForm 用于呈现上传对话框中使用的表单。您可以在 web.config 或 episerver.config 中的标记中指定从中加载表单的文件。

文件已处理,所有 xform 标签均替换为 XForms 的 EPiServer Web 控件。然后 Page.ParseControl 用于将文本转换为用户控件。该字符串不能包含任何代码,因为 ParseControl 方法永远不会导致编译,但您可以使用其他 Web 控件。

只有一小步是额外的。由于文本被转换为 xml 文档,因此您需要将命名空间添加到元素本身或根标签。

<root ... xmlns:asp="dummy1" > ...
      <td class="EP-tableCaptionCell">
        <label for="id_field2" id="id_field1" style="margin-bottom: 10px;"> 
            <asp:Label runat="server"
                       Text="TEST!"/>
            <EPiServer:Translate xmlns:EPiServer="dummy2"
                                 runat="server"
                                 Text="/admin/admingroup/addgroup" />
        </label>
      </td>

EPiServer CMS feature XForm is used to render the form used in the upload dialog. You specify the file where the form is loaded from in a tag in web.config or episerver.config.

The file is processed and all xform-tags are replaced with EPiServer Web Controls for XForms. Then Page.ParseControl is used to transform the text into a User Control. This string cannot contain any code, because the ParseControl method never causes compilation but you can use other web controls.

There is only one small extra step. Since the text is converted to an xml document you need to add namespace either to the element itself or the root-tag.

<root ... xmlns:asp="dummy1" > ...
      <td class="EP-tableCaptionCell">
        <label for="id_field2" id="id_field1" style="margin-bottom: 10px;"> 
            <asp:Label runat="server"
                       Text="TEST!"/>
            <EPiServer:Translate xmlns:EPiServer="dummy2"
                                 runat="server"
                                 Text="/admin/admingroup/addgroup" />
        </label>
      </td>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文