Skip to content

Commit

Permalink
fix: use current culture
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Feb 4, 2024
1 parent 936b290 commit a873e10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/GZCTF/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ public class Program
{
public static bool IsTesting { get; set; }

internal static IStringLocalizer<Program> StaticLocalizer { get; } = new CulturedLocalizer<GZCTF.Program>(new CultureInfo("en-US"));
internal static IStringLocalizer<Program> StaticLocalizer { get; } =
new CulturedLocalizer<Program>(CultureInfo.CurrentCulture);

internal static void Banner()
{
Expand Down Expand Up @@ -389,8 +390,8 @@ public static IActionResult InvalidModelStateHandler(ActionContext context)
: StaticLocalizer[nameof(Resources.Program.Model_ValidationFailed)])) { StatusCode = 400 };

errors = (from val in context.ModelState.Values
where val.Errors.Count > 0
select val.Errors.FirstOrDefault()?.ErrorMessage).FirstOrDefault();
where val.Errors.Count > 0
select val.Errors.FirstOrDefault()?.ErrorMessage).FirstOrDefault();

return new JsonResult(new RequestResponse(errors is [_, ..]
? errors
Expand Down

0 comments on commit a873e10

Please sign in to comment.