Fix fluent plural forms.
This commit is contained in:
committed by
abcdefg30
parent
8a9426a0d4
commit
5bcb1a678c
@@ -56,7 +56,7 @@ namespace OpenRA
|
||||
return;
|
||||
|
||||
bundle = LinguiniBuilder.Builder()
|
||||
.CultureInfo(CultureInfo.InvariantCulture)
|
||||
.CultureInfo(new CultureInfo(language))
|
||||
.SkipResources()
|
||||
.SetUseIsolating(false)
|
||||
.UseConcurrent()
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA
|
||||
ParseTranslations(language, translations, fileSystem, onError);
|
||||
}
|
||||
|
||||
public Translation(string text, Action<ParseError> onError)
|
||||
public Translation(string language, string text, Action<ParseError> onError)
|
||||
{
|
||||
var parser = new LinguiniParser(text);
|
||||
var resource = parser.Parse();
|
||||
@@ -73,7 +73,7 @@ namespace OpenRA
|
||||
onError(error);
|
||||
|
||||
bundle = LinguiniBuilder.Builder()
|
||||
.CultureInfo(CultureInfo.InvariantCulture)
|
||||
.CultureInfo(new CultureInfo(language))
|
||||
.SkipResources()
|
||||
.SetUseIsolating(false)
|
||||
.UseConcurrent()
|
||||
|
||||
@@ -27,7 +27,7 @@ label-players = {$player ->
|
||||
[TestCase(TestName = "Fluent Plural Terms")]
|
||||
public void TestOne()
|
||||
{
|
||||
var translation = new Translation(pluralForms, e => Console.WriteLine(e.Message));
|
||||
var translation = new Translation("en", pluralForms, e => Console.WriteLine(e.Message));
|
||||
var label = translation.GetString("label-players", Translation.Arguments("player", 1));
|
||||
Assert.That("One player", Is.EqualTo(label));
|
||||
label = translation.GetString("label-players", Translation.Arguments("player", 2));
|
||||
|
||||
Reference in New Issue
Block a user