Adds an optimized formatter for localization. Example:
```cs
string localizationText = Localization.Format(1050039, "enu", $"{m_Amount}\t{LabelNumber:#}");
```
Fixes #1044
19 lines
590 B
C#
19 lines
590 B
C#
using Xunit;
|
|
|
|
namespace Server.Tests;
|
|
|
|
public class LocalizationEntryTests
|
|
{
|
|
[Fact]
|
|
public void TestClilocAsParameter()
|
|
{
|
|
Localization.Add("enu", 500002, "This tests ~1_NUMBER~ as parameters.");
|
|
Localization.Add("enu", 500003, "clilocs");
|
|
|
|
string numericFormatter = Localization.Format(500002, "enu", $"{500003:#}");
|
|
string stringParam = Localization.Format(500002, "enu", $"{"#500003"}");
|
|
|
|
Assert.Equal("This tests clilocs as parameters", numericFormatter);
|
|
Assert.Equal("This tests clilocs as parameters", stringParam);
|
|
}
|
|
}
|