Add support for translation attributes.

This commit is contained in:
Matthias Mailänder
2022-10-25 21:31:36 +02:00
committed by Gustas
parent 760a1245c5
commit e251377f7c
3 changed files with 84 additions and 51 deletions

View File

@@ -7,7 +7,7 @@
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Linguini.Bundle" Version="0.3.1" />
<PackageReference Include="Linguini.Bundle" Version="0.3.2" />
<PackageReference Include="OpenRA-Eluant" Version="1.0.18" />
<PackageReference Include="Mono.NAT" Version="3.0.3" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />

View File

@@ -101,7 +101,7 @@ namespace OpenRA
foreach (var (k, v) in arguments)
fluentArguments.Add(k, v.ToFluentType());
var result = bundle.TryGetAttrMsg(key, fluentArguments, out var errors, out value);
var result = bundle.TryGetAttrMessage(key, fluentArguments, out var errors, out value);
foreach (var error in errors)
Log.Write("debug", $"Translation of {key}: {error}");
@@ -118,7 +118,7 @@ namespace OpenRA
public bool HasMessage(string key)
{
return bundle.HasMessage(key);
return bundle.HasAttrMessage(key);
}
// Adapted from Fluent.Net.SimpleExample.TranslationService by Mark Weaver