Workplace XT 根據要求傳入的用戶端語言環境,查閱內容資源組合中的使用者介面字串。Workplace XT XML 配置檔中標籤元素的用途,是置換資源組合中的使用者介面字串。如下列 XML Snippet 所示,此元素可讓您設定多個語言環境的資源字串。在 XML 中設定多種語言字串的功能,讓您省去在資源組合中修改字串的工作。
<object key="searchOptionGroup">
<label key="label" localizationKey="server.SimpleSearch_xml.useTheseSearchOptions">
<resource>Use these search options:</resource>
<resource locale="en_US">Use these search options:</resource>
<resource locale="fr_FR">employez ces options pour faire une recherche:</resource>
</label>
...
附註 Workplace XT 使用 XLIFF 檔擴增現有的資源組合檔。XLIFF 檔支援顯示本地化的使用者編寫名稱。應用程式間接使用 XLIFF 檔,其方式是公開「偏好的語言環境」使用者喜好設定,並將瀏覽器語言環境傳遞至 Web 應用程式,以確保載入正確的特定語言 XLIFF 檔。如果有提供的話,「處理程序引擎」伺服器會從 XLIFF 檔擷取本地化使用者定義名稱字串,供名冊、佇列、里程碑、步驟、工作流程和各種其他欄位運用。相反地,應用程式會直接使用資源組合檔,而「處理程序引擎」並不直接這麼做。
若該要求指定了特定用戶端語言環境,應用程式會使用下列優先順序來查閱資源字串:
如果標頭中的一個或多個語言環境並沒有資源組合,應用程式會再次依照瀏覽器語言環境標頭指定的順序,試圖在 XML 中尋找語言環境相符項目。如果沒有相符項目,應用程式會預設為設定在資源元素(其無指定的語言環境)中的英文字串。在上面的 XML 中,應用程式會使用「使用這些搜尋選項:」字串。
如果找不到相符的項目,應用程式會使用 localizationKey 內容的值來擷取資源組合中的標籤。假設有上述 XML,如果用戶端語言環境是 "es-us" (Spanish American),則應用程式會使用 "server.SimpleSearch_xml.useTheseSearchOptions" 值來查閱 Spanish American 資源組合中的標籤。
<object key="configurableLabels" version="4.0.0">
<label key="objectStore" localizationKey="server.ConfigurableLabels_xml.ObjectStore">
<resource>Object Store</resource>
<resource locale="en_US">Library</resource>
<resource locale="fr_FR">Bibliothèque</resource>
</label>
附註 完整多種語言支援需要使用者所有語言的資源組合。請勿僅僅仰賴應用程式的 XML 語言環境支援;否則,應用程式的使用者介面將顯示不同語言字串的混合。
<object key="configurableLabels" version="4.0.0">
<label key="objectStore" localizationKey="server.ConfigurableLabels_xml.ObjectStore">
<resource>Object Store</resource>
<resource locale="en_US">Library</resource>
<resource locale="fr_FR">Bibliothèque</resource>
</label>
<object key="configurableLabels" version="4.0.0">
<label key="objectStore" localizationKey="server.ConfigurableLabels_xml.ObjectStore">
<resource>Object Store</resource>
<resource locale="en_US">Library</resource>
</label>
<object key="configurableLabels" version="4.0.0">
<label key="objectStore" localizationKey="server.ConfigurableLabels_xml.ObjectStore">
<resource>Object Store</resource>
<resource locale="en_US">Library</resource>
</label>