在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Knoema/Localization开源软件地址(OpenSource Url):https://github.com/Knoema/Localization开源编程语言(OpenSource Language):C# 59.8%开源软件介绍(OpenSource Introduction):How to install:
routes.IgnoreRoute("_localization/{*route}");
<system.web.webPages.razor>
...
<pages pageBaseType="Knoema.Localization.Mvc.LocalizedWebViewPage">
...
</system.web.webPages.razor>
ModelValidatorProviders.Providers.Clear();
ModelValidatorProviders.Providers.Add(new ValidationLocalizer());
ModelMetadataProviders.Current = new MetadataLocalizer();
@RenderLocalizationIncludes(User.IsInRole("Admin")) Admins will see admin tool, where they can translate strings or import/export them. How to use:Localization in cshtml files:<p>@R("Hello world!")</p> With parameteres: <p>@R("Hello {0}!", username)</p> Localization in cs files:"Hello world!".Resource(this) Localization of models:[Localized]
public class SignInViewModel
{
[Required(ErrorMessage = "Please provide your e-mail")]
[Display(Name = "E-mail")]
public string EMail { get; set; }
[Required(ErrorMessage = "Please type your password")]
public string Password { get; set; }
} Localization in javascript$.localize(text, scope); For scope you can use path to script file e.g. "~/scripts/shared/site.js". |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论