ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
how to localize the DatePicker
Title:
B
I
{code}
?
I can't localize datepicker for my language (italian) this is my source <script src="@Url.Content("/lib/AwesomeMvc/AwesomeMvc.js")" type="text/javascript"></script> <script src="@Url.Content("/lib/AwesomeMvc/awem.js")" type="text/javascript"></script> <script src="@Url.Content("/lib/AwesomeMvc/utils.js")" type="text/javascript"></script> @{ var currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName; <script src="@Url.Content("~/lib/AwesomeMvc/aweui/awedict/awedict." + currentCulture + ".js")" type="text/javascript"></script> } @Html.Awe().Init()
Save Changes
Cancel
Meccanica Rossi
asked at 17 Dec 2021
Answers
B
I
{code}
?
in asp.net core you can do this in your layout page: var rcf = Context.Features.Get<IRequestCultureFeature>(); var cultureName = rcf.RequestCulture.UICulture.Name; var supportedCultures = new string[] {"it", "en", "fr", "de", "ro", "ru", "es"}; ... @if (supportedCultures.Contains(cultureName)) { <script src="~/js/awedict/awedict.@(cultureName).js"></script> } ... <script> if (awedict) { awem.clientDict = awedict; } </script> @Html.Awe().Init() you could also choose to generate the awedict at the server and ignore the awedict.js files, example: awem.clientDict = @Html.Raw(Json.Encode(myServerGeneratedDict));
Save Changes
Cancel
Omu
answered at 17 Dec 2021
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK