Add msbuild target for building translations. Closes #1076.

This commit is contained in:
Thomas Goyne 2012-11-14 07:08:43 -08:00
parent 9a2b8fc408
commit 73696b8efa
3 changed files with 21 additions and 1 deletions

View File

@ -185,4 +185,15 @@
<ProjectTools Include="AegisubConfig" /> <ProjectTools Include="AegisubConfig" />
</ItemGroup> </ItemGroup>
<!-- Compile translations if msgfmt is available -->
<Target Name="Translations"
AfterTargets="ClCompile"
Condition="'$(MsgFmtPath)'!=''"
Inputs="@(MsgFmt)"
Outputs="$(AegisubBinaryDir)locale\%(Filename)\aegisub.mo"
>
<Error Condition="!Exists($(MsgFmtPath))" Text="$(MsgFmtPath) not found" />
<MakeDir Directories="$(AegisubBinaryDir)locale\%(MsgFmt.Filename)" />
<Exec Command="$(MsgFmtPath) -o $(AegisubBinaryDir)locale\%(MsgFmt.Filename)\aegisub.mo %(MsgFmt.Identity)" />
</Target>
</Project> </Project>

View File

@ -459,6 +459,9 @@
<ItemGroup> <ItemGroup>
<ResourceCompile Include="$(SrcDir)res.rc" /> <ResourceCompile Include="$(SrcDir)res.rc" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<MsgFmt Include="$(AegisubSourceBase)po\*.po" />
</ItemGroup>
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
<Import Project="$(MSBuildThisFileDirectory)Aegisub.targets" /> <Import Project="$(MSBuildThisFileDirectory)Aegisub.targets" />
</ImportGroup> </ImportGroup>

View File

@ -78,6 +78,12 @@
DisplayName="Update Checker URL" DisplayName="Update Checker URL"
Description="URL to get for updates." Description="URL to get for updates."
/> />
<StringProperty
Name="MsgFmtPath"
Category="Config"
DisplayName="msgfmt.exe location"
Description="Location of msgfmt.exe, for compiling translations"
/>
<!-- External Libraries --> <!-- External Libraries -->
<BoolProperty <BoolProperty