Skip to content

Commit 710ee8f

Browse files
committed
jquery.validate localization file mismatch fixed
1 parent cc3573b commit 710ee8f

File tree

1 file changed

+16
-1
lines changed
  • aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Layout

1 file changed

+16
-1
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Layout/_Layout.cshtml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,22 @@
101101

102102
@if (CultureInfo.CurrentUICulture.Name != "en")
103103
{
104-
<script src="~/libs/jquery-validate/localization/[email protected](CultureInfo.CurrentUICulture.Name.Replace("-", "_") + ".js")" asp-append-version="true"></script>
104+
var normalizedCurrentUICultureName = CultureInfo.CurrentUICulture.Name.Replace("-", "_");
105+
var localizationFileNameWithExtension = "messages_";
106+
switch (normalizedCurrentUICultureName)
107+
{
108+
case "zh_Hans":
109+
localizationFileNameWithExtension += "zh";
110+
break;
111+
case "es_MX":
112+
localizationFileNameWithExtension += "es";
113+
break;
114+
default:
115+
localizationFileNameWithExtension += normalizedCurrentUICultureName;
116+
break;
117+
}
118+
localizationFileNameWithExtension += ".min.js";
119+
<script src="~/libs/jquery-validate/localization/@localizationFileNameWithExtension" asp-append-version="true"></script>
105120
}
106121

107122
<script type="text/javascript">

0 commit comments

Comments
 (0)