Skip to content

Commit

Permalink
cache spanishCulture (#1307)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 11, 2024
1 parent d084652 commit ea7fb1e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ public override string Convert(int number, string numberString, GrammaticalGende
return $"{numberString}{genderMap[gender]}";
}

static CultureInfo _spanishCulture = new("es-ES");

private static string GetNumberString(int number)
{
return number.ToString(new CultureInfo("es-ES"));
return number.ToString(_spanishCulture);
}

private static string GetWordForm(int number, WordForm wordForm)
Expand Down

0 comments on commit ea7fb1e

Please sign in to comment.