summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-12-27 20:23:31 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-12-27 20:24:51 -0800
commit6050732e725c68b83c35c873ff8808dff1c406e1 (patch)
tree36cf32676f9a3448804f8276258c53a4b7d2af22 /tools
parent6bbf14504b96b3a6fe24dc18abf98eb13872583c (diff)
downloadDotNetOpenAuth-6050732e725c68b83c35c873ff8808dff1c406e1.zip
DotNetOpenAuth-6050732e725c68b83c35c873ff8808dff1c406e1.tar.gz
DotNetOpenAuth-6050732e725c68b83c35c873ff8808dff1c406e1.tar.bz2
Added translation .targets file to facilitate coordination with external string resource translators.
Diffstat (limited to 'tools')
-rw-r--r--tools/Translation.targets39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/Translation.targets b/tools/Translation.targets
new file mode 100644
index 0000000..21b27be
--- /dev/null
+++ b/tools/Translation.targets
@@ -0,0 +1,39 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ExportedTxtResourcesIntermediateDir>$(IntermediatePath)ExportedTxtResources</ExportedTxtResourcesIntermediateDir>
+ <ExportedTxtResourcesIntermediateDir Condition=" '$(Culture)' != '' ">$(ExportedTxtResourcesIntermediateDir).$(Culture)</ExportedTxtResourcesIntermediateDir>
+ <ExportedTxtResourcesIntermediateDir>$(ExportedTxtResourcesIntermediateDir)\</ExportedTxtResourcesIntermediateDir>
+
+ <ExportedTxtResourcesZip>$(IntermediatePath)$(ProductName) resources</ExportedTxtResourcesZip>
+ <ExportedTxtResourcesZip Condition=" '$(Culture)' != '' ">$(ExportedTxtResourcesZip).$(Culture)</ExportedTxtResourcesZip>
+ <ExportedTxtResourcesZip>$(ExportedTxtResourcesZip).zip</ExportedTxtResourcesZip>
+ </PropertyGroup>
+ <Target Name="ExportResX">
+ <ItemGroup Condition=" '$(Culture)' != '' " >
+ <ResXFilesToExport Include="$(ProjectRoot)src\$(ProductName)\**\*.$(Culture).resx" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ResXNewCulture Condition=" '@(ResXFilesToExport)' == '' ">.$(Culture)</ResXNewCulture>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(Culture)' == '' or '$(ResXNewCulture)' != '' ">
+ <ResXFilesToExport Include="$(ProjectRoot)src\$(ProductName)\**\*.resx" />
+ <ResXFilesToExport Remove="$(ProjectRoot)src\$(ProductName)\**\*.*.resx" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResXFilesToExport>
+ <ExportedFullPath>$(ExportedTxtResourcesIntermediateDir)%(RecursiveDir)%(FileName)$(ResXNewCulture).txt</ExportedFullPath>
+ <ExportedDirectory>$(ExportedTxtResourcesIntermediateDir)%(RecursiveDir)</ExportedDirectory>
+ </ResXFilesToExport>
+ <ExportedTxtDirectories Include="@(ResXFilesToExport->'%(ExportedDirectory)')" />
+ <ExportedTxtFiles Include="@(ResXFilesToExport->'%(ExportedFullPath)')" />
+ </ItemGroup>
+ <Warning Condition=" '$(ResXNewCulture)' != '' " Text="No culture '$(Culture)' exists in the source project. Synthesizing new one from default culture." />
+ <MakeDir Directories="%(ResXFilesToExport.ExportedDirectory)" Condition="!Exists('%(ResXFilesToExport.ExportedDirectory)')" />
+ <Exec Command="resgen.exe %(ResXFilesToExport.Identity) %(ResXFilesToExport.ExportedFullPath)" />
+ <Purge Directories="@(ExportedTxtDirectories)" IntendedFiles="@(ExportedTxtFiles)" />
+ <Delete Files="$(ExportedTxtResourcesZip)" />
+ <Zip ZipFileName="$(ExportedTxtResourcesZip)"
+ WorkingDirectory="$(ExportedTxtResourcesIntermediateDir)"
+ Files="@(ExportedTxtFiles)" />
+ </Target>
+</Project> \ No newline at end of file