<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information. -->
<Rule Name="Package" Description="與產生 NuGet 套件相關的屬性。" DisplayName="套件" PageTemplate="generic" Order="400" xmlns="http://schemas.microsoft.com/build/2009/properties">
  <Rule.Categories>
    <Category Name="General" DisplayName="一般" Description="套件的一般設定。" />
    <Category Name="License" DisplayName="授權" Description="指定套件的授權。" />
  </Rule.Categories>
  <Rule.DataSource>
    <DataSource Persistence="ProjectFileWithInterception" SourceOfDefaultValue="AfterContext" HasConfigurationCondition="False" />
  </Rule.DataSource>
  <BoolProperty Name="GeneratePackageOnBuild" DisplayName="在建置時產生 NuGet 套件" Description="在建置作業期間產生套件檔案。" Category="General" />
  <StringProperty Name="PackageId" DisplayName="套件識別碼" Description="不區分大小寫的套件識別碼，在 nuget.org 或套件所在的任何資源庫中均不得重複。識別碼不能包含對 URL 無效的空格或字元，而且通常會遵循 .NET 命名空間規則。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147131" Category="General">
    <StringProperty.Metadata>
      <NameValuePair Name="DependsOn" Value="Application::AssemblyName" />
    </StringProperty.Metadata>
  </StringProperty>
  <StringProperty Name="Version" DisplayName="套件版本" Description="套件的版本，遵循 major.minor.patch 模式。版本號碼可能包含發行前版本尾碼。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147132" Category="General" />
  <StringProperty Name="Authors" DisplayName="作者" Description="套件作者的逗點分隔清單，符合 nuget.org 上的設定檔名稱。其會顯示在 nuget.org 上的 NuGet Gallery 中，可用於交互參照由相同作者所製作的套件。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147237" Category="General">
    <StringProperty.Metadata>
      <NameValuePair Name="DependsOn" Value="Application::AssemblyName" />
    </StringProperty.Metadata>
  </StringProperty>
  <StringProperty Name="Company" DisplayName="公司" Category="General">
    <StringProperty.Metadata>
      <NameValuePair Name="DependsOn" Value="Package::Authors" />
    </StringProperty.Metadata>
  </StringProperty>
  <StringProperty Name="Product" DisplayName="產品" Category="General">
    <StringProperty.Metadata>
      <NameValuePair Name="DependsOn" Value="Application::AssemblyName" />
    </StringProperty.Metadata>
  </StringProperty>
  <StringProperty Name="Description" DisplayName="說明" Description="用於 UI 顯示的套件說明。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147238" Category="General" />
  <StringProperty Name="Copyright" DisplayName="著作權" Description="套件的著作權詳細資料。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147133" Category="General" />
  <StringProperty Name="PackageProjectUrl" DisplayName="專案 URL" Description="套件首頁的 URL，通常顯示在 UI 顯示及 nuget.org 中。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147240" Category="General" />
  <!-- TODO (tomescht): 
       We should re-think this. This property is the relative path to the icon file _within the package_; setting it does not guarantee
       that the corresponding file in the project is correctly copied into the package. A better alternative may be to expose a property
       with the path to the file in the project instead, and update this one appropriately when that one changes.
  -->
  <StringProperty Name="PackageIcon" DisplayName="圖示檔案" Description="從套件根路徑到圖示檔案的相對路徑。除了設定此屬性之外，您還需要確認檔案已包含在套件中。影像檔大小限制為 1 MB。支援的檔案格式包括 JPEG 及 PNG。建議使用 128x128 的影像解析度。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147134" Category="General" />
  <StringProperty Name="RepositoryUrl" DisplayName="存放庫 URL" Description="指定留存或建置專案原始程式碼的存放庫 URL。若要連結至專案頁面，請改用 [專案 URL] 欄位。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147241" Category="General" />
  <StringProperty Name="RepositoryType" DisplayName="存放庫類型" Description="指定存放庫的類型。預設為 'git'。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147241" Category="General" />
  <StringProperty Name="PackageTags" DisplayName="標籤" Description="標籤及關鍵字的分號分隔清單，用以說明套件，有助於透過搜尋與篩選找到套件。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147135" Category="General" />
  <StringProperty Name="PackageReleaseNotes" DisplayName="版本資訊" Description="在此版套件中進行的變更描述，通常用於 UI (如 Visual Studio 套件管理員的 [更新] 索引標籤) 以取代套件說明。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147242" Category="General" />
  <DynamicEnumProperty Name="NeutralLanguage" DisplayName="組件中性語言" EnumProvider="NeutralLanguageEnumProvider" MultipleValuesAllowed="False" Category="General" />
  <StringProperty Name="AssemblyVersion" DisplayName="組件版本" Category="General" />
  <StringProperty Name="FileVersion" DisplayName="檔案版本" Category="General" />
  <!-- TODO add help URL? -->
  <EnumProperty Name="PackageLicenseKind" DisplayName="套件授權" Description="指定專案之套件的授權。" Category="License">
    <EnumProperty.DataSource>
      <DataSource Persistence="ProjectFileWithInterception" HasConfigurationCondition="False" />
    </EnumProperty.DataSource>
    <EnumValue Name="None" DisplayName="無" />
    <EnumValue Name="Expression" DisplayName="SPDX 授權運算式" />
    <EnumValue Name="File" DisplayName="內嵌的檔案" />
  </EnumProperty>
  <StringProperty Name="PackageLicenseExpression" DisplayName="授權運算式" Description="SPDX 授權運算式，通常顯示在 nuget.org 等的 UI 中。" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147239" Category="License">
    <StringProperty.Metadata>
      <NameValuePair Name="DependsOn" Value="Package::PackageLicenseKind" />
      <NameValuePair Name="VisibilityCondition">
        <NameValuePair.Value>(eq "Expression" (evaluated "Package" "PackageLicenseKind"))</NameValuePair.Value>
      </NameValuePair>
    </StringProperty.Metadata>
  </StringProperty>
  <!-- TODO add a fwlink for this action URL -->
  <StringProperty Name="ReadAboutSpdxExpressions" DisplayName="閱讀 SPDX 授權運算式" Category="License">
    <StringProperty.DataSource>
      <DataSource PersistedName="ReadAboutSpdxExpressions" Persistence="ProjectFileWithInterception" HasConfigurationCondition="False" />
    </StringProperty.DataSource>
    <StringProperty.ValueEditors>
      <ValueEditor EditorType="LinkAction">
        <ValueEditor.Metadata>
          <NameValuePair Name="Action" Value="URL" />
          <NameValuePair Name="URL" Value="https://spdx.org/licenses/" />
        </ValueEditor.Metadata>
      </ValueEditor>
    </StringProperty.ValueEditors>
    <StringProperty.Metadata>
      <NameValuePair Name="VisibilityCondition">
        <NameValuePair.Value>(eq "Expression" (evaluated "Package" "PackageLicenseKind"))</NameValuePair.Value>
      </NameValuePair>
    </StringProperty.Metadata>
  </StringProperty>
  <StringProperty Name="PackageLicenseFile" DisplayName="授權檔案" HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147239" Category="License" Subtype="file">
    <StringProperty.Metadata>
      <NameValuePair Name="DependsOn" Value="Package::PackageLicenseKind" />
      <NameValuePair Name="VisibilityCondition">
        <NameValuePair.Value>(eq "File" (evaluated "Package" "PackageLicenseKind"))</NameValuePair.Value>
      </NameValuePair>
    </StringProperty.Metadata>
  </StringProperty>
  <BoolProperty Name="PackageRequireLicenseAcceptance" DisplayName="需要接受授權" Description="安裝此套件時，提示使用者接受授權。" Category="License">
    <BoolProperty.Metadata>
      <NameValuePair Name="DependsOn" Value="Package::PackageLicenseKind" />
      <NameValuePair Name="VisibilityCondition">
        <NameValuePair.Value>(ne "None" (evaluated "Package" "PackageLicenseKind"))</NameValuePair.Value>
      </NameValuePair>
    </BoolProperty.Metadata>
  </BoolProperty>
</Rule>