在 SharePoint Server 中规划多语言用户界面

适用于:yes-img-132013 yes-img-162016 yes-img-192019 yes-img-seSubscription Edition yes-img-sopSharePoint in Microsoft 365

使用多语言用户界面 (MUI) 功能,用户可以在 Microsoft 365 网站中以他们喜欢的语言(而不是创建网站时选择的默认语言)显示 SharePoint Server 或 SharePoint 的用户界面。 本文介绍 MUI 功能的用法和优势,说明该功能的工作原理,并列出了该功能支持的其他特性和功能。 它还介绍了如何添加和编辑应用程序内容,以及如何导出和导入内容进行翻译。 本文介绍了如何将 MUI 功能与托管元数据配合使用,并介绍了该功能的限制。 最后,本文介绍如何在 SharePoint Server 网站解决方案中规划使用 MUI 功能。

有关如何规划多语言网站的信息,请参阅 在 SharePoint Server 中规划多语言网站

多语言用户界面的工作方式

默认情况下,新建的网站采用服务器上安装的 SharePoint Server 的默认语言。 场管理员必须先在 SharePoint 场的所有 Web 服务器和应用程序服务器上安装语言包,然后才能创建采用非默认语言的网站。 有关详细信息,请参阅安装或卸载 SharePoint Server 2016 和 2019 的语言包和安装或卸载 SharePoint 2013 的语言包

After language packs are installed on the server, the Language settings link is added to the Site Settings page. Site collection administrators and site owners use the Language Settings page to specify which alternate languages the site will support. After the site collection administrator or site owner has enabled alternate languages for a site, the next time that a user logs on to the site, SharePoint Server uses one of the following rules to determine the language in which to display content to the user:

  1. 如果在 SharePoint Server 服务器场上启用了 User Profile Service 应用程序,将使用存储在用户配置文件中的语言首选项。 有关如何向 SharePoint Server 中的用户配置文件设置添加语言列表的信息,请参阅 在 SharePoint Server 用户配置文件中添加、编辑或删除自定义属性。 有关如何在 SharePoint 管理员中心将语言列表添加到用户配置文件设置的信息,请参阅添加和编辑用户配置文件属性

  2. 如果未在用户配置文件中定义任何语言首选项,将使用存储在网站集的用户语言设置中的语言首选项。

  3. 如果未在用户网站集中定义任何语言首选项,将使用存储在用户 Web 浏览器中的语言首选项。

  4. 如果未在用户 Web 浏览器中定义任何语言首选项,将使用默认的网站语言。

MUI 功能只会使用用户首选的语言显示网站的用户界面元素。 它不会翻译内容或使用备用语言显示诸如文档或列表项等内容。 若要翻译网页内容,请使用 SharePoint Server 或 Microsoft 365 中的 SharePoint 中的变体功能。

SharePoint Server 提供三种更改特定应用程序内容(如列表或库标题和说明)的方法:使用用户界面、导出和导入网站翻译以及使用 Microsoft.SharePoint 命名空间中的 SPUserResource 类。 并非所有的用户界面元素都可以直接在用户界面中更改。 例如,用户操作和命令只能通过使用 SPUserResource 类进行更改。 有关更多信息,请参阅 SPUserResource 类

有关如何安装语言包的信息,请参阅 安装或卸载 SharePoint Server 2016 和 2019 的语言包。 有关如何允许单个用户更改用于显示其网站用户界面的语言的信息,请参阅选择想要允许在网站用户界面上使用的语言

多语言用户界面功能的用途和好处

MUI 功能允许用户通过使用其首选的其他语言在单个网站中进行协作,而不用顾及创建网站时使用的是哪种语言。 例如,网站的默认语言可能是英语,但首选语言为法语的用户可以使用法语来查看网站,且首选语言为西班牙语的用户可以使用西班牙语来查看网站。

When you create a site and install language packs on all the web and application servers, you can specify the default site language. The site will use that language to display the site's user interface, such as site navigation and administrative pages. If you want to enable site users to view the site's user interface in a preferred language, you can use the Language Settings page to specify alternate languages that you want to make available to users. When a user logs on to the site, the users preferred language is used to display the site's user interface. All sites within that domain name are displayed in the user's preferred language. This does not change the default site language. Other users who view the site see the site's user interface displayed either in the default site language or in their preferred language. The site's user interface is changed only for those users who have specified a preferred language in which to view the site.

通过使用 MUI 功能,工作组成员可以使用共享的语言处理文档和项目,同时使用其首选语言来查看网站和执行任务。 除了团队协作外,MUI 功能还允许服务器场和网站集管理员和网站所有者使用他们的首选语言执行管理任务。 例如,服务器场管理员可以使用其首选语言来查看 SharePoint 管理中心网站 上的管理链接和指示。

MUI 功能还允许用户更改新的和现有的应用程序内容(例如列表或库标题和说明)并且允许用户在其他语言用户的用户界面中反映这些更改。 例如,使用英语作为首选语言的团队成员会创建名为“团队报告”的新文档库。另一位将首选语言设置为德语的团队成员登录到该网站,并将库标题更改为“Mannschaftsberichte”。下次将首选语言设置为德语的用户登录到网站时,文档库的名称将显示为“Mannschaftsberichte”。但是,将首选语言设置为英语的用户仍会看到文档库名称显示为“团队报告”。

多语言用户界面支持的内容

在用户使用首选语言查看网站时,将使用首选语言显示用户界面的特定元素。 通常,大多数用户界面元素都可以采用首选语言显示,但是用户创建的内容除外。 下面的列表包含了 MUI 功能支持的项目示例:

  • 设置页面,如 _layouts 和 _admin 虚拟目录中的页面。

  • SharePoint 帮助。

  • 应用程序内容,如菜单、控件、网站操作、网站标题和说明、列表或库标题和说明、顶部链接栏链接、快速启动链接、本地痕迹导航、网站和列表内容类型,以及网站和列表列。

  • 开发人员内容,例如功能和解决方案。

  • 列表视图。

  • Web 部件标题、说明、自定义属性和导入错误消息。

  • 博客网站模板。

并非所有的用户界面元素都将以首选语言显示。 下面的列表包含了 MUI 功能不支持的项目示例:

  • 全局痕迹导航。

  • 用户创建的内容,例如列表项目数据、库中的文档和网页、自定义权限级别和组。

有关 MUI 功能不支持的用户界面元素的详细信息,请参阅多语言用户界面的限制

管理应用程序内容

应用程序内容包括诸如菜单、控件、网站操作、网站标题和说明、列表或库标题和说明、顶部链接栏链接、快速启动链接、本地痕迹导航、网站和列表内容类型,以及网站和列表列等内容。 MUI 功能允许用户使用默认的网站语言或以一种或多种备用语言添加或编辑应用程序内容。 您也可以选择导入和导出应用程序内容以进行批量翻译。

添加和编辑应用程序内容

在用户添加或编辑应用程序内容时,将应用以下规则:

  • 当用户使用默认的网站语言查看网站时,他们创建的任何新应用程序内容将以默认的网站语言显示,甚至在使用其他语言查看网站时也是如此。

    例如,如果默认的网站语言是英语,在用户使用英语查看网站并创建了名为“Team Documents”的新文档库后,即使用户使用法语查看网站,库标题仍将显示为"Team Documents"。

  • 若用户使用其他语言查看网站,他们创建的任何新应用程序内容将以该语言显示,甚至在使用默认网站语言或任何其他语言查看网站时也是如此。

    For example, if the default site language is English, and a user views the site in German and adds a document library named "Mannschaftsdokumente," the library title is displayed as "Mannschaftsdokumente" even when the site is viewed in English. To translate application content, such as a document library title into the default site language or into an alternate language, users must first change the language preference either in their user profile, or in their web browser settings, to display the site in the language they want to use, and then change the user interface string. The exception to this behavior is if the Overwrite Translations option is enabled. For more information, see Overwriting translated application content.

如果网站以用户首选语言显示,则对现有应用程序内容字符串的任何更改仅适用于该语言。 以默认网站语言和任何备用语言显示的与特定应用程序内容关联的字符串将保持不变。 要翻译应用程序内容字符串,例如将文档库标题翻译为默认网站语言或任何备用语言,用户必须在浏览器或用户配置文件中更改语言首选项,以使用默认语言或切换语言显示网站,然后对用户界面字符串进行更改。

覆盖已翻译的应用程序内容

The Language Settings page contains an Overwrite Translations option that affects how changes to existing application content are made to other languages for the site. If the Overwrite Translations option is enabled, any changes that are made to the user interface in the default site language will overwrite any changes that were made to those same user interface elements in switch languages.

By default, when a user views a site in the default site language, any changes that are made to existing application content are changed for the default site language only. The strings that are associated with specific application content in the alternate languages remain unchanged. If the Overwrite Translations option is enabled, the strings that are associated with that application content for every language are replaced with the new default site language string. For example, if the default site language is English and a user changes the title of the "Shared Documents" library to "Team Documents," by default, the title is changed only for the default site language. If the Overwrite Translations option is enabled, the title is changed to "Team Documents" for every alternate language, and it must be re-translated.

导出和导入已翻译的应用程序内容

The MUI feature lets you export and import application content for bulk translation. Instead of translating application content one item at a time, you can export the strings for any new or changed application content in the default site language or in one of the alternate languages. To export content, you use the Export Translations link on the Site Settings page. When you export application content for an alternate language, you can choose to export all content or only content that has not been translated.

When the application content is exported, it is saved as a .resx file, which can be opened by using a text editor or any third-party tool that can open resource files. For more information, see Resources in .resx File Format. After the resource strings are translated, you use the Import Translations link on the Site Settings page to import the .resx file.

在托管元数据中使用多语言用户界面

可以创建多语言托管元数据以便在 SharePoint Server 解决方案中使用。 通过使用术语库管理工具,可以创建术语集和关联多个标签(针对术语集中的每个术语,为每种要支持的语言添加一个标签)。 当用户以用户首选语言查看网站时,将使用与首选语言对应的标签显示数据。

多语言用户界面的限制

如前所述,某些用户界面元素无法启用 MUI,即 MUI 功能不支持这些内容。 本节介绍了当您在共享组件和网站模板中使用 MUI 功能时适用的其他限制。

共享组件

共享组件(例如,列表和权限)在整个网站模板上显示。 它们的功能已进行了集中定义,并且不论它们在哪种网站模板内显示,它们的行为都是一致的。

列表

列表视图支持 MUI,但是列表项却不支持,这是因为它们是用户创建的内容。 列表项仍将显示创建它们时输入的值,而不管用户首选的语言是什么。

权限

以下与权限关联的属性不支持 MUI。 它们将始终以默认的网站语言或以创建它们时使用的语言进行显示:

  • 权限组名称 它们包括默认的权限组名称和任何由用户创建的自定义权限组。

  • 自定义权限级别名称和说明 它们包括任何由用户创建或更改的自定义权限级别。

  • 用户信息 诸如关于我、标题和部门等用户信息。

搜索网站模板

许多搜索网站的限制实际上与 MUI 功能无关,但其体系结构设计却能够影响用户界面。 下面的限制是针对搜索网站的 MUI 和体系结构限制的组合:

  • 搜索 搜索将使用安装 SharePoint Server 的默认语言为内容编制索引。 即使内容是使用备用语言提供的,也只能通过使用默认网站语言才能搜索内容。 例如,如果您的首选语言是德语,但默认的网站语言是英语,搜索"Freigegebene Dokumente"不会返回任何结果。 搜索"Shared Documents"则会返回结果。

  • 搜索 Web 部件属性 标题、说明和自定义属性支持 MUI。 但是如果自定义了搜索框的默认搜索提示,那么将为所有语言显示自定义的值。

  • 精简面板 Web 部件 精简面板 Web 部件不支持 MUI。 精简面板 Web 部件中显示的术语库标签始终从搜索索引中显示,该索引仅使用默认网站语言存储术语。 例如,如果您的首选语言为意大利语,但默认网站语言为英语,并且您的文档使用包含用于两种语言的值的术语库标签,精简面板 Web 将仅显示英语标签。

    注意

    这并不适用于分类精简面板 Web 部件,它将显示托管导航中使用的同一语言标签。

计划使用多语言用户界面

计划在 SharePoint Server 网站中使用 MUI 功能涉及以下任务:

  • 确定网站语言要求。

  • 计划安装公开更新。

  • 计划翻译应用程序内容。

确定网站语言要求。

场管理员必须先在所有 Web 服务器和应用程序服务器上安装语言包,使其对网站可用,然后才能在 SharePoint Server 网站中使用 MUI 功能。 决定需要哪些语言包,以及何时在服务器上安装它们。 网站集管理员或网站所有者必须为各个网站配置语言设置,以便特定语言对网站用户可用。 必须决定每个网站所需的语言,并计划让网站集管理员或网站所有者为自己管理的网站启用特定语言。 若要详细了解如何计划多语言网站,请参阅在 SharePoint Server 中规划多语言网站。 有关如何安装语言包的信息,请参阅 安装或卸载 SharePoint Server 2016 和 2019 的语言包安装或卸载 SharePoint 2013 的语言包

计划安装公开更新

如果语言包是作为 SharePoint Server 的公开更新的一部分进行更新的,那么必须在安装公开更新时更新服务器上的语言包。 应该规划与服务器场管理员进行协作,监视公开更新的版本以及任何关联的语言包,以便了解必须为用户安装哪些更新的语言包。

计划翻译应用程序内容

如果您计划在网站上启用 MUI 功能,以便在用户使用其首选语言时为他们提供协作方法,您必须判断默认的 MUI 功能是否足够满足需要,或者是否必须翻译应用程序内容。 如果存在必须翻译的应用程序内容,您应该考虑以下问题:

  • 如何翻译新的和现有的应用程序内容? 是由单独的工作组成员根据需要直接在用户界面中翻译应用程序内容,还是由您使用网站所需的语言导出资源文件,然后在同一时间全部翻译它们? 如果用户使用备用语言创建新的应用程序内容,您必须规划由谁来将该内容翻译为默认网站语言和各种备用语言。 如果您计划创建复杂的页面(例如,新的菜单页)或开发自定义的解决方案(例如,创建列表的功能),您必须规划使用对象模型来提供备用语言的翻译。

  • 由谁来翻译应用程序内容? 是由您组织中的某个成员来翻译,还是由第三方来翻译?

  • 如何处理应用程序内容的更新? 是直接在更改时翻译对用户界面的更改,还是安排定期更改? 这可能取决于网站的大小和规模以及所包含的内容。

  • How should translation overwrites be handled? Do you want changes in the default site language to overwrite string values in alternate languages? If so, then you must enable the Overwrite Translations option on the Language Settings page.

  • 必须更改哪些列名? 必须翻译哪些列名称,以及翻译哪些语言? 列名称是位于列表级别还是网站级别?

另请参阅

概念

在 SharePoint Server 中规划多语言网站

SharePoint Server 中的变体概述

在 SharePoint Server 中规划变体

其他资源

SharePoint Server 2019 语言包

SharePoint Server 2016 语言包

SharePoint Server 2013 语言包