Skip to content

Commit

Permalink
修复国际化资源文件Resources.AdminLocalizer.en.json在开发和发布环境下不能输出到Resources目录的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhontai committed Oct 15, 2024
1 parent 9d6c922 commit 04e1335
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZhonTai.Admin" Version="8.5.1">
<CopyToOutputDirectory>*\*\*.xml</CopyToOutputDirectory>
</PackageReference>
<PackageReference Include="ZhonTai.Admin" Version="8.5.1" />
</ItemGroup>

<ItemGroup>
<Folder Include="Services\" />
</ItemGroup>


<Target Name="AfterTargetsBuild" AfterTargets="Build">
<ItemGroup>
<PackageReferenceFiles Condition="'%(PackageReference.CopyToOutputDirectory)' != ''" Include="$(NugetPackageRoot)\$([MSBuild]::Escape('%(PackageReference.Identity)').ToLower())\%(PackageReference.Version)\%(PackageReference.CopyToOutputDirectory)" />
<PackageReferenceXmlFiles Include="$(NugetPackageRoot)\$([MSBuild]::Escape('%(PackageReference.Identity)').ToLower())\%(PackageReference.Version)\**\*.xml" />
<PackageReferenceJsonFiles Include="$(NugetPackageRoot)\$([MSBuild]::Escape('%(PackageReference.Identity)').ToLower())\%(PackageReference.Version)\**\*.json" />
</ItemGroup>
<Copy Condition="'%(PackageReference.CopyToOutputDirectory)' != ''" SourceFiles="@(PackageReferenceFiles)" DestinationFolder="./../MyApp.Host/$(OutDir)" />

<Copy Condition="'%(PackageReferenceXmlFiles.Identity)' != ''" SourceFiles="@(PackageReferenceXmlFiles)" DestinationFolder="./../MyApp.Host/$(OutDir)" />
<Copy Condition="'%(PackageReferenceJsonFiles.Identity)' != ''" SourceFiles="@(PackageReferenceJsonFiles)" DestinationFolder="./../MyApp.Host/$(OutDir)Resources" />
</Target>
</Project>
6 changes: 4 additions & 2 deletions templates/admin/content/src/MyApp.Host/MyApp.Host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@

<Target Name="AfterTargetsPublish" AfterTargets="Publish">
<ItemGroup>
<PackageReferenceFiles Include="*\*\*\*.xml" />
<PackageReferenceXmlFiles Include="*\*\*\*.xml" />
<PackageReferenceJsonFiles Include="*\*\*\Resources\*.json" />
</ItemGroup>
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="@(PackageReferenceXmlFiles)" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="@(PackageReferenceJsonFiles)" DestinationFolder="$(PublishDir)Resources" />
</Target>
</Project>
3 changes: 2 additions & 1 deletion ui/zhontai.ui.admin.vue3/src/utils/other.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export function useTitle() {
} else {
webTitle = setTagsViewNameI18n(router.currentRoute.value)
}
document.title = `${webTitle} - ${globalTitle}` || globalTitle

document.title = webTitle ? `${webTitle} - ${globalTitle}` : globalTitle
})
}

Expand Down

0 comments on commit 04e1335

Please sign in to comment.