Skip to content

Commit 3c0d2e0

Browse files
Add L10N to the name of optional components (#647)
* Add L10N to the components in XNAMessageBox * Error while include string extension * Remove L10N from logging string * Add L10N support for ClientUpdater * Update CustomComponent.cs * Delete L10N from GUI name for custom components in `ComponentsPanel` --------- Co-authored-by: SadPencil <[email protected]>
1 parent 29c44cd commit 3c0d2e0

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

ClientUpdater/ClientUpdater.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88
<PackageReference Include="Microsoft.AspNet.WebApi.Client" />
99
<PackageReference Include="Rampastring.Tools" />
1010
</ItemGroup>
11+
<ItemGroup>
12+
<ProjectReference Include="..\ClientCore\ClientCore.csproj" />
13+
</ItemGroup>
1114
</Project>

ClientUpdater/CustomComponent.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
namespace ClientUpdater;
1717

18+
using ClientCore.Extensions;
19+
1820
using System;
1921
using System.Collections.Generic;
2022
using System.IO;
@@ -117,7 +119,7 @@ public CustomComponent()
117119
/// </summary>
118120
public CustomComponent(string guiName, string iniName, string downloadPath, string localPath, bool isDownloadPathAbsolute = false, bool noArchiveExtensionForDownloadPath = false)
119121
{
120-
GUIName = guiName;
122+
GUIName = guiName.L10N($"INI:CustomComponents:{iniName}:UIName");
121123
ININame = iniName;
122124
LocalPath = localPath;
123125
DownloadPath = downloadPath;

DTAConfig/OptionPanels/ComponentsPanel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public override void Initialize()
6565
{
6666
Name = "lbl" + c.ININame,
6767
ClientRectangle = new Rectangle(12, btn.Y + 2, 0, 0),
68-
Text = c.GUIName.L10N($"INI:CustomComponents:{c.ININame}:UIName")
68+
Text = c.GUIName
6969
};
7070

7171
AddChild(btn);

DXMainClient/DXMainClient.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@
3737
</ItemGroup>
3838
<ItemGroup>
3939
<ProjectReference Include="..\DTAConfig\DTAConfig.csproj" />
40+
<ProjectReference Include="..\ClientUpdater\ClientUpdater.csproj" />
4041
</ItemGroup>
4142
</Project>

DXMainClient/PreStartup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public static void Initialize(StartupParams parameters)
177177
ClientCore.Generated.TranslationNotifier.Register();
178178
ClientGUI.Generated.TranslationNotifier.Register();
179179
DTAConfig.Generated.TranslationNotifier.Register();
180+
ClientUpdater.Generated.TranslationNotifier.Register();
180181
DTAClient.Generated.TranslationNotifier.Register();
181182
}
182183
}

Directory.Build.props

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@
3939
<Engine Condition="$(Configuration.Contains(WindowsXNA))">WindowsXNA</Engine>
4040
</PropertyGroup>
4141

42-
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'ClientCore' Or '$(MSBuildProjectName)' == 'ClientGUI' Or '$(MSBuildProjectName)' == 'DTAConfig' Or '$(MSBuildProjectName)' == 'DXMainClient'">
42+
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'ClientCore' Or '$(MSBuildProjectName)' == 'ClientGUI' Or '$(MSBuildProjectName)' == 'DTAConfig' Or '$(MSBuildProjectName)' == 'DXMainClient' Or '$(MSBuildProjectName)' == 'ClientUpdater'">
4343
<TargetFrameworks Condition="$(Engine.Contains(Windows))">net48;net8.0-windows</TargetFrameworks>
4444
<TargetFrameworks Condition="!$(Engine.Contains(Windows))">net8.0</TargetFrameworks>
4545

4646
<Platforms>AnyCPU;x64;x86;ARM64</Platforms>
47-
<Platforms Condition="'$(MSBuildProjectName)' == 'TranslationNotifierGenerator'">AnyCPU</Platforms>
4847
<!-- XNA only supports x86, but the other engines support any CPU. -->
4948
<Platform Condition="$(Engine.Contains(XNA))">x86</Platform>
50-
<Platform Condition="'$(MSBuildProjectName)' == 'TranslationNotifierGenerator'">AnyCPU</Platform>
5149
<!-- WinForms Auto Configure -->
5250
<UseWindowsForms Condition="$(Engine.Contains(Windows))">true</UseWindowsForms>
5351
</PropertyGroup>
@@ -57,7 +55,7 @@
5755
<Platforms>AnyCPU</Platforms>
5856
</PropertyGroup>
5957

60-
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'ClientUpdater' OR '$(MSBuildProjectName)' == 'SecondStageUpdater'">
58+
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'SecondStageUpdater'">
6159
<TargetFrameworks>net8.0;net48</TargetFrameworks>
6260
<Platforms>AnyCPU</Platforms>
6361
</PropertyGroup>

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<PackageVersion Include="System.Management" Version="$(DotnetLibrariesVersion)" />
3030
<PackageVersion Include="System.Text.Encoding.CodePages" Version="$(DotnetLibrariesVersion)" />
3131
</ItemGroup>
32-
<ItemGroup Condition="'$(MSBuildProjectName)' == 'ClientCore' Or '$(MSBuildProjectName)' == 'ClientGUI' Or '$(MSBuildProjectName)' == 'DTAConfig' Or '$(MSBuildProjectName)' == 'DXMainClient'">
32+
<ItemGroup Condition="'$(MSBuildProjectName)' == 'ClientCore' Or '$(MSBuildProjectName)' == 'ClientGUI' Or '$(MSBuildProjectName)' == 'DTAConfig' Or '$(MSBuildProjectName)' == 'DXMainClient' Or '$(MSBuildProjectName)' == 'ClientUpdater'">
3333
<ProjectReference Include="$(MSBuildThisFileDirectory)TranslationNotifierGenerator\TranslationNotifierGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
3434
</ItemGroup>
3535
<!-- Polyfill -->

0 commit comments

Comments
 (0)