Skip to content
Permalink
Browse files

[Localization] Rearranged targets so that localization code is unified

  • Loading branch information
xen2 committed Mar 5, 2019
1 parent f1d652d commit 4ef26603cdd8cba96cc1ad9e42dbc824cbc76588
@@ -5,6 +5,7 @@
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<XenkoAssemblyProcessor>true</XenkoAssemblyProcessor>
<XenkoPackAssets>true</XenkoPackAssets>
<XenkoLocalized>true</XenkoLocalized>
<TargetFramework>$(TargetFrameworkTool)</TargetFramework>
<XenkoAssemblyProcessorOptions>--auto-module-initializer --serialization --parameter-key</XenkoAssemblyProcessorOptions>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\build\</SolutionDir>
@@ -799,12 +800,4 @@
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="$([System.String]::Copy('%(ReferenceCopyLocalPaths.FileName)').StartsWith('Microsoft.VisualStudio.'))" />
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PostBuildEvent>Path=$(RoslynTargetsPath);$(Path)
IF EXIST "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale fr "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ja "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale es "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale de "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ru "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" --verbose</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -6,6 +6,7 @@
<TargetFramework>$(TargetFrameworkTool)</TargetFramework>
<XenkoAssemblyProcessor>true</XenkoAssemblyProcessor>
<XenkoAssemblyProcessorOptions>--auto-module-initializer --serialization</XenkoAssemblyProcessorOptions>
<XenkoLocalized>true</XenkoLocalized>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
@@ -427,14 +428,6 @@
<Import Project="..\..\editor\Xenko.Core.MostRecentlyUsedFiles\Xenko.Core.MostRecentlyUsedFiles.projitems" Label="Shared" />
<Import Project="$(XenkoPostSettingsTargets)" />
<Import Project="Sdk.targets" Sdk="MSBuild.Sdk.Extras" Version="1.6.65" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PostBuildEvent>Path=$(RoslynTargetsPath);$(Path)
IF EXIST "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale fr "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ja "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale es "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale de "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ru "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" --verbose</PostBuildEvent>
</PropertyGroup>

<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeExtraAssemblies</TargetsForTfmSpecificBuildOutput>
@@ -1,9 +1,10 @@
<Project>
<Project>
<Import Project="..\..\targets\Xenko.PreSettings.targets" />
<Import Project="Sdk.props" Sdk="MSBuild.Sdk.Extras" Version="1.6.65" />
<PropertyGroup>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<XenkoAssemblyProcessor>true</XenkoAssemblyProcessor>
<XenkoLocalized>true</XenkoLocalized>
<TargetFramework>$(TargetFrameworkTool)</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -87,12 +88,4 @@
</ItemGroup>
<Import Project="$(XenkoPostSettingsTargets)" />
<Import Project="Sdk.targets" Sdk="MSBuild.Sdk.Extras" Version="1.6.65" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PostBuildEvent>Path=$(MSBuildBinPath)\Roslyn;$(Path)
IF EXIST "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale fr "$(SolutionDir)..\sources\localization\ja\$(TargetName).fr.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ja "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale es "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale de "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ru "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" --verbose</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -16,6 +16,7 @@
<AssemblyName>Xenko.GameStudio</AssemblyName>
<XenkoAssemblyProcessor>true</XenkoAssemblyProcessor>
<XenkoAssemblyProcessorOptions>--auto-module-initializer</XenkoAssemblyProcessorOptions>
<XenkoLocalized>true</XenkoLocalized>
<DefineConstants>XENKO_NUGET_RESOLVER_UX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -230,21 +231,6 @@
</ItemGroup>
<Import Project="$(XenkoPostSettingsTargets)" />
<Import Project="Sdk.targets" Sdk="MSBuild.Sdk.Extras" Version="1.6.65" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PostBuildEvent>Path=$(RoslynTargetsPath);$(Path)
IF EXIST "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale fr "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ja "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale es "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale de "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ru "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" --verbose</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeExtraAssemblies</TargetsForTfmSpecificBuildOutput>
@@ -8,6 +8,7 @@
<TargetFramework>$(TargetFrameworkTool)</TargetFramework>
<XenkoAssemblyProcessor>true</XenkoAssemblyProcessor>
<XenkoAssemblyProcessorOptions>--auto-module-initializer --serialization</XenkoAssemblyProcessorOptions>
<XenkoLocalized>true</XenkoLocalized>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\build\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
@@ -76,15 +77,6 @@
<Import Project="$(XenkoPostSettingsTargets)" />
<Import Project="Sdk.targets" Sdk="MSBuild.Sdk.Extras" Version="1.6.65" />

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PostBuildEvent>Path=$(RoslynTargetsPath);$(Path)
IF EXIST "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale fr "$(SolutionDir)..\sources\localization\fr\$(TargetName).fr.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ja "$(SolutionDir)..\sources\localization\ja\$(TargetName).ja.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale es "$(SolutionDir)..\sources\localization\es\$(TargetName).es.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale de "$(SolutionDir)..\sources\localization\de\$(TargetName).de.po" --verbose
IF EXIST "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" "$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe" --lib-dir "$(SolutionDir)..\deps\Gettext.Net" --resource $(TargetName) -d "$(TargetDir)." --locale ru "$(SolutionDir)..\sources\localization\ru\$(TargetName).ru.po" --verbose</PostBuildEvent>
</PropertyGroup>

<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeExtraAssemblies</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
@@ -164,4 +164,20 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<!-- Generate localization satellite assemblies -->
<Target Name="XenkoGenerateLocalizationSatelliteDlls" BeforeTargets="SatelliteDllsProjectOutputGroup" Returns="@(SatelliteDllsProjectOutputGroupOutput)" Condition="'$(XenkoLocalized)' == 'true' And '$(Configuration)' == 'Release'">
<ItemGroup>
<!-- Current list of languages to try to generate -->
<XenkoTraductions Include="fr;ja;es;de;ru"/>
</ItemGroup>
<Exec Condition="Exists('$(SolutionDir)..\sources\localization\%(XenkoTraductions.Identity)\$(TargetName).%(XenkoTraductions.Identity).po')" Command="Path=$(RoslynTargetsPath);$(Path)
&quot;$(SolutionDir)..\deps\Gettext.Net\GNU.Gettext.Msgfmt.exe&quot; --lib-dir &quot;$(SolutionDir)..\deps\Gettext.Net&quot; --resource $(TargetName) -d &quot;$(TargetDir).&quot; --locale %(XenkoTraductions.Identity) &quot;$(MSBuildThisFileDirectory)..\localization\%(XenkoTraductions.Identity)\$(TargetName).%(XenkoTraductions.Identity).po&quot; --verbose" />
<ItemGroup>
<SatelliteDllsProjectOutputGroupOutputIntermediate Include="$(OutDir)%(XenkoTraductions.Identity)\$(TargetName).Messages.resources.dll" Condition="Exists('$(OutDir)%(XenkoTraductions.Identity)\$(TargetName).Messages.resources.dll')">
<TargetPath>%(XenkoTraductions.Identity)\$(TargetName).Messages.resources.dll</TargetPath>
<Culture>%(XenkoTraductions.Identity)</Culture>
</SatelliteDllsProjectOutputGroupOutputIntermediate>
</ItemGroup>
</Target>

</Project>

0 comments on commit 4ef2660

Please sign in to comment.
You can’t perform that action at this time.