Add a test case for Fluent plural forms.
This commit is contained in:
committed by
abcdefg30
parent
dd9ab16401
commit
8a9426a0d4
@@ -65,6 +65,23 @@ namespace OpenRA
|
||||
ParseTranslations(language, translations, fileSystem, onError);
|
||||
}
|
||||
|
||||
public Translation(string text, Action<ParseError> onError)
|
||||
{
|
||||
var parser = new LinguiniParser(text);
|
||||
var resource = parser.Parse();
|
||||
foreach (var error in resource.Errors)
|
||||
onError(error);
|
||||
|
||||
bundle = LinguiniBuilder.Builder()
|
||||
.CultureInfo(CultureInfo.InvariantCulture)
|
||||
.SkipResources()
|
||||
.SetUseIsolating(false)
|
||||
.UseConcurrent()
|
||||
.UncheckedBuild();
|
||||
|
||||
bundle.AddResourceOverriding(resource);
|
||||
}
|
||||
|
||||
void ParseTranslations(string language, string[] translations, IReadOnlyFileSystem fileSystem, Action<ParseError> onError)
|
||||
{
|
||||
// Always load english strings to provide a fallback for missing translations.
|
||||
|
||||
Reference in New Issue
Block a user