1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 08:58:06 +02:00

Merge remote-tracking branch 'henricj/locale'

This commit is contained in:
James Crook 2018-04-02 18:08:39 +01:00
commit 3880558e2d
7 changed files with 54 additions and 308 deletions

View File

@ -15,6 +15,9 @@
<RootNamespace>locale</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Audacity">
<MsgfmtCommand>$(MSBuildThisFileDirectory)..\..\packages\Gettext.Tools.0.19.8.1\tools\bin\msgfmt</MsgfmtCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Utility</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
@ -24,9 +27,6 @@
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="po.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -45,29 +45,11 @@
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PostBuildEvent>
<Command>for %%I in ("%WXWIN%\locale\*.po") do call :fmt %%~nI
goto :EOF
:fmt
if not exist "$(OutDir)Languages\%1" mkdir "$(OutDir)Languages\%1"
msgfmt -o "$(OutDir)Languages\%1\wxstd.mo" "%WXWIN%\locale\%1.po"
goto :EOF
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PostBuildEvent>
<Command>for %%I in ("%WXWIN%\locale\*.po") do call :fmt %%~nI
goto :EOF
:fmt
if not exist "$(OutDir)Languages\%1" mkdir "$(OutDir)Languages\%1"
msgfmt -o "$(OutDir)Languages\%1\wxstd.mo" "%WXWIN%\locale\%1.po"
goto :EOF
</Command>
</PostBuildEvent>
<ItemDefinitionGroup>
<msgfmt>
<OutputName>$(OutDir)Languages\%(Filename)\Audacity.mo</OutputName>
<Message>Compiling %(Filename) locale</Message>
</msgfmt>
</ItemDefinitionGroup>
<ItemGroup>
<msgfmt Include="..\..\..\locale\af.po" />
@ -127,10 +109,46 @@ goto :EOF
<msgfmt Include="..\..\..\locale\zh_TW.po" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\locale\audacity.pot" />
<msgfmt Include="$(WXWIN)\locale\gl_ES.po">
<OutputName>$(OutDir)Languages\gl\wxstd.mo</OutputName>
<Message>Compiling wxWidgets %(Filename) to gl locale</Message>
<Visible>false</Visible>
</msgfmt>
<msgfmt Include="$(WXWIN)\locale\ko_KR.po">
<OutputName>$(OutDir)Languages\ko\wxstd.mo</OutputName>
<Message>Compiling wxWidgets %(Filename) to ko locale</Message>
<Visible>false</Visible>
</msgfmt>
<msgfmt Include="$(WXWIN)\locale\pt.po">
<OutputName>$(OutDir)Languages\pt_PT\wxstd.mo</OutputName>
<Message>Compiling wxWidgets %(Filename) to pt_PT locale</Message>
<Visible>false</Visible>
</msgfmt>
<msgfmt Include="$(WXWIN)\locale\*.po" Exclude="@(msgfmt)">
<OutputName>$(OutDir)Languages\%(Filename)\wxstd.mo</OutputName>
<Message>Compiling wxWidgets %(Filename) locale</Message>
<Visible>false</Visible>
</msgfmt>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\locale\audacity.pot" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<OutputPaths Include="@(msgfmt->'%(OutputName)')" />
<OutputDirs Include="@(OutputPaths-&gt;'%(RootDir)%(Directory)'-&gt;Distinct())" />
<CustomBuildStep Include="@(msgfmt)">
<Command>"$(MsgfmtCommand)" -o "%(OutputName)" "%(FullPath)"</Command>
<Inputs>%(FullPath)</Inputs>
<Outputs>%(OutputName)</Outputs>
</CustomBuildStep>
</ItemGroup>
<Target Name="MakeOutputDirs" BeforeTargets="CustomBuildStep">
<MakeDir Directories="@(OutputDirs)" />
</Target>
<Target Name="CleanOutput" BeforeTargets="AfterClean">
<Delete Files="@(OutputPaths)" />
<RemoveDir Directories="@(OutputDirs);$(OutDir)Languages" />
</Target>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="po.targets" />
</ImportGroup>
</Project>
</Project>

View File

@ -176,5 +176,6 @@
<None Include="..\..\..\locale\audacity.pot">
<Filter>Source Files</Filter>
</None>
<None Include="packages.config" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Gettext.Tools" version="0.19.8.1" targetFramework="native" />
</packages>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup
Condition="'$(msgfmtBeforeTargets)' == '' and '$(msgfmtAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">
<msgfmtBeforeTargets>Midl</msgfmtBeforeTargets>
<msgfmtAfterTargets>CustomBuild</msgfmtAfterTargets>
</PropertyGroup>
<PropertyGroup>
<msgfmtDependsOn
Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(msgfmtDependsOn)</msgfmtDependsOn>
</PropertyGroup>
<ItemDefinitionGroup>
<msgfmt>
<Verbose>False</Verbose>
<OutputName>$(OutDir)Languages\%(Filename)\Audacity.mo</OutputName>
<CommandLineTemplate>msgfmt [AllOptions] [AdditionalOptions] [inputs]</CommandLineTemplate>
<Outputs>%(OutputName)</Outputs>
<ExecutionDescription>Compiling %(Filename) locale</ExecutionDescription>
</msgfmt>
</ItemDefinitionGroup>
</Project>

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
Name="Message Compiler"
Version="8.00"
>
<Rules>
<CustomBuildRule
Name="msgfmt"
DisplayName="Compile Locale"
CommandLine="msgfmt [AllOptions] [AdditionalOptions] [inputs]"
Outputs="[$OutputName]"
FileExtensions="*.po"
ExecutionDescription="Compiling $(InputName) locale"
>
<Properties>
<StringProperty
Name="OutputName"
DisplayName="Output File"
Description="Specifies a name to override the default file name"
Switch="-o &quot;[value]&quot;"
DefaultValue="$(OutDir)\Languages\$(InputName)\Audacity.mo"
Delimited="true"
/>
<BooleanProperty
Name="Verbose"
DisplayName="Verbose"
Description="Increase verbosity level"
Switch="-v"
/>
</Properties>
</CustomBuildRule>
</Rules>
</VisualStudioToolFile>

View File

@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema
Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName
Include="msgfmt">
<Targets>_msgfmt</Targets>
</AvailableItemName>
</ItemGroup>
<UsingTask
TaskName="msgfmt"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="_msgfmt"
BeforeTargets="$(msgfmtBeforeTargets)"
AfterTargets="$(msgfmtAfterTargets)"
Condition="'@(msgfmt)' != ''"
DependsOnTargets="$(msgfmtDependsOn);ComputemsgfmtOutput"
Outputs="@(msgfmt-&gt;Metadata('Outputs')-&gt;Distinct())"
Inputs="@(msgfmt);%(msgfmt.AdditionalDependencies);$(MSBuildProjectFile)">
<ItemGroup
Condition="'@(SelectedFiles)' != ''">
<msgfmt
Remove="@(msgfmt)"
Condition="'%(Identity)' != '@(SelectedFiles)'" />
</ItemGroup>
<ItemGroup>
<msgfmt_tlog
Include="%(msgfmt.Outputs)"
Condition="'%(msgfmt.Outputs)' != '' and '%(msgfmt.ExcludedFromBuild)' != 'true'">
<Source>@(msgfmt, '|')</Source>
</msgfmt_tlog>
</ItemGroup>
<Message
Importance="High"
Text="%(msgfmt.ExecutionDescription)" />
<WriteLinesToFile
Condition="'@(msgfmt_tlog)' != '' and '%(msgfmt_tlog.ExcludedFromBuild)' != 'true'"
File="$(TLogLocation)$(ProjectName).write.1.tlog"
Lines="^%(msgfmt_tlog.Source);@(msgfmt_tlog-&gt;'%(Fullpath)')" />
<msgfmt
Condition="'@(msgfmt)' != '' and '%(msgfmt.ExcludedFromBuild)' != 'true'"
CommandLineTemplate="%(msgfmt.CommandLineTemplate)"
Verbose="%(msgfmt.Verbose)"
OutputName="%(msgfmt.OutputName)"
AdditionalOptions="%(msgfmt.AdditionalOptions)"
Inputs="@(msgfmt)" />
</Target>
<PropertyGroup>
<ComputeLinkInputsTargets>
$(ComputeLinkInputsTargets);
ComputemsgfmtOutput;
</ComputeLinkInputsTargets>
<ComputeLibInputsTargets>
$(ComputeLibInputsTargets);
ComputemsgfmtOutput;
</ComputeLibInputsTargets>
</PropertyGroup>
<Target
Name="ComputemsgfmtOutput"
Condition="'@(msgfmt)' != ''">
<ItemGroup>
<msgfmtDirsToMake
Condition="'@(msgfmt)' != '' and '%(msgfmt.ExcludedFromBuild)' != 'true'"
Include="%(msgfmt.Outputs)" />
<Link
Include="%(msgfmtDirsToMake.Identity)"
Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
<Lib
Include="%(msgfmtDirsToMake.Identity)"
Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
<ImpLib
Include="%(msgfmtDirsToMake.Identity)"
Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
</ItemGroup>
<MakeDir
Directories="@(msgfmtDirsToMake-&gt;'%(RootDir)%(Directory)')" />
</Target>
</Project>

View File

@ -1,140 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">
<Rule
Name="msgfmt"
PageTemplate="tool"
DisplayName="Compile Locale"
Order="200">
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="msgfmt" />
</Rule.DataSource>
<Rule.Categories>
<Category
Name="General">
<Category.DisplayName>
<sys:String>General</sys:String>
</Category.DisplayName>
</Category>
<Category
Name="Command Line"
Subtype="CommandLine">
<Category.DisplayName>
<sys:String>Command Line</sys:String>
</Category.DisplayName>
</Category>
</Rule.Categories>
<StringListProperty
Name="Inputs"
Category="Command Line"
IsRequired="true"
Switch=" ">
<StringListProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="msgfmt"
SourceType="Item" />
</StringListProperty.DataSource>
</StringListProperty>
<BoolProperty
Name="Verbose"
HelpContext="0"
DisplayName="Verbose"
Description="Increase verbosity level"
Switch="-v" />
<StringListProperty
Name="OutputName"
HelpContext="0"
DisplayName="Output File"
Description="Specifies a name to override the default file name"
Separator=";"
Switch="-o &quot;[value]&quot;" />
<StringProperty
Name="CommandLineTemplate"
DisplayName="Command Line"
Visible="False"
IncludeInCommandLine="False" />
<DynamicEnumProperty
Name="msgfmtBeforeTargets"
Category="General"
EnumProvider="Targets"
IncludeInCommandLine="False">
<DynamicEnumProperty.DisplayName>
<sys:String>Execute Before</sys:String>
</DynamicEnumProperty.DisplayName>
<DynamicEnumProperty.Description>
<sys:String>Specifies the targets for the build customization to run before.</sys:String>
</DynamicEnumProperty.Description>
<DynamicEnumProperty.ProviderSettings>
<NameValuePair
Name="Exclude"
Value="^msgfmtBeforeTargets|^Compute" />
</DynamicEnumProperty.ProviderSettings>
<DynamicEnumProperty.DataSource>
<DataSource
Persistence="ProjectFile"
HasConfigurationCondition="true" />
</DynamicEnumProperty.DataSource>
</DynamicEnumProperty>
<DynamicEnumProperty
Name="msgfmtAfterTargets"
Category="General"
EnumProvider="Targets"
IncludeInCommandLine="False">
<DynamicEnumProperty.DisplayName>
<sys:String>Execute After</sys:String>
</DynamicEnumProperty.DisplayName>
<DynamicEnumProperty.Description>
<sys:String>Specifies the targets for the build customization to run after.</sys:String>
</DynamicEnumProperty.Description>
<DynamicEnumProperty.ProviderSettings>
<NameValuePair
Name="Exclude"
Value="^msgfmtAfterTargets|^Compute" />
</DynamicEnumProperty.ProviderSettings>
<DynamicEnumProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType=""
HasConfigurationCondition="true" />
</DynamicEnumProperty.DataSource>
</DynamicEnumProperty>
<StringListProperty
Name="Outputs"
DisplayName="Outputs"
Visible="False"
IncludeInCommandLine="False" />
<StringProperty
Name="ExecutionDescription"
DisplayName="Execution Description"
Visible="False"
IncludeInCommandLine="False" />
<StringListProperty
Name="AdditionalDependencies"
DisplayName="Additional Dependencies"
IncludeInCommandLine="False"
Visible="false" />
<StringProperty
Subtype="AdditionalOptions"
Name="AdditionalOptions"
Category="Command Line">
<StringProperty.DisplayName>
<sys:String>Additional Options</sys:String>
</StringProperty.DisplayName>
<StringProperty.Description>
<sys:String>Additional Options</sys:String>
</StringProperty.Description>
</StringProperty>
</Rule>
<ItemType
Name="msgfmt"
DisplayName="Compile Locale" />
<FileExtension
Name="*.po"
ContentType="msgfmt" />
<ContentType
Name="msgfmt"
DisplayName="Compile Locale"
ItemType="msgfmt" />
</ProjectSchemaDefinitions>