如何:新增資源檔How to: Add a resource file

新增資源檔的命令位於 [方案] 節點的快捷方式功能表和方案總管中的功能節點。The commands for adding resource files is on the shortcut menu of the solution node and feature nodes in Solution Explorer. 如需詳細資訊,請參閱 當地語系化 SharePoint 方案For more information, see Localizing SharePoint solutions.

將全域資源檔加入至 SharePoint 方案To add a global resource file to a SharePoint solution

  1. 在中 Visual StudioVisual Studio ,開啟 SharePoint 方案。In Visual StudioVisual Studio, open a SharePoint solution.

  2. 方案總管 中,選擇 SharePoint 專案節點,然後在功能表列上選擇 [專案 > 加入新專案]。In Solution Explorer, choose a SharePoint project node, and then, on the menu bar, choose Project > Add New Item.

  3. 在 [ 加入新專案 ] 對話方塊中,選擇 [ 全域資源檔 ] 範本,然後選擇 [ 加入 ] 按鈕。In the Add New Item dialog box, choose the Global Resources File template, and then choose the Add button.

    注意

    只有在選取 SharePoint 專案專案時,才會顯示全域資源檔專案專案範本。The Global Resources File project item template appears only when a SharePoint project item is selected.

  4. 在 [ 新增資源 ] 對話方塊中,選擇資源檔的文化特性,例如 [英文 (美國) 。In the Add Resource dialog box, choose a culture for the resource file, such as English (United States).

    此步驟會以 Resource_x_ 的格式,將全域資源檔加入至您的方案 文化特性 resx,例如, Resource1This step adds a global resource file to your solution in the format, Resource_x_ .culture.resx, such as, Resource1.en-US.resx.

  5. 資源編輯器 在中開啟時 Visual StudioVisual Studio ,請將資源新增至資源檔。When the Resource Editor opens in Visual StudioVisual Studio, add resources to the resource file.

將功能資源檔新增至 SharePoint 功能To add a feature resource file to a SharePoint feature

  1. 如果 SharePoint 方案尚未在中開啟 Visual StudioVisual Studio ,請開啟方案。If the SharePoint solution is not already open in Visual StudioVisual Studio, open the solution.

  2. 方案總管 中,開啟 [ 功能 ] 節點下之功能名稱的快捷方式功能表,然後選擇 [ 加入功能資源]。In Solution Explorer, open the shortcut menu for the name of a feature under the Features node, and then choose Add Feature Resource.

    此步驟會將資源檔新增至功能,格式為 ResourceFileNameculture,例如,Feature1,例如: en-usThis step adds a resource file to the feature in the format, ResourceFileName.culture.resx, such as, Feature1.en-US.resx.

  3. 資源編輯器 在中開啟時 Visual StudioVisual Studio ,請將資源新增至資源檔。When the Resource Editor opens in Visual StudioVisual Studio, add resources to the resource file.

另請參閱See also