Description
Persian DataAnnotations as DataAnnotations localizer library, is a localization of System.ComponentModel.DataAnnotations for Persian (Farsi) language. It's useful for Persian ASP.NET Core MVC & ASP.NET MVC based applications. The localization of built-in resource of DataAnnotations is a bit hard to work (specialy in ASP.NET MVC) and this library helps your project for localization error messages just with single call a method. Fork and Translate RESX resources for your language ;-)
PersianDataAnnotations alternatives and similar packages
Based on the "Application Frameworks" category.
Alternatively, view PersianDataAnnotations alternatives based on common mentions on social networks and blogs.
-
CoreFX
This repo is used for servicing PR's for .NET Core 2.1 and 3.1. Please visit us at https://github.com/dotnet/runtime -
Introducing .NET Multi-platform App UI (MAUI)
.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop. -
ASP.NET Boilerplate
ASP.NET Boilerplate - Web Application Framework -
Mono
Mono open source ECMA CLI, C# and .NET implementation. -
ABP
Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation. -
Uno Platform
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. -
DotNetty
DotNetty project – a port of netty, event-driven asynchronous network application framework -
AspectCore Framework
AspectCore is an AOP-based cross platform framework for .NET Standard. -
Kentor Authentication Services
Saml2 Authentication services for ASP.NET -
Microdot Framework
Microdot: An open source .NET microservices framework -
CSLA .NET
A home for your business logic in any .NET application. -
Fusion
Build real-time apps (Blazor included) with less than 1% of extra code responsible for real-time updates. Host 10-1000x faster APIs relying on transparent and nearly 100% consistent caching. We call it DREAM, or Distributed REActive Memoization, and it's here to turn real-time on! -
X.PagedList
Library for easily paging through any IEnumerable/IQueryable in ASP.NET -
ASP.NET MVC Boilerplate Framework
.NET Core Extensions and Helper NuGet packages. -
peasy
A business logic micro-framework for .NET and .NET Core -
rxweb
Tons of extensively featured packages for Angular, VUE and React Projects -
Mono-Addins
Mono.Addins is a generic framework for creating extensible applications, and for creating add-ins which extend those applications. -
silky
The Silky framework is designed to help developers quickly build a microservice development framework through simple code and configuration under the .net platform. -
Newbe.Claptrap
This is a frameworks with reactive, event sourcing and Actor pattern as basic theories. On top of this, developers can create "distributed", "scale out", and "easy to test" application more simply. Claptrap and it`s Minions is on the way. -
DWKit
DWKit is a Business Process Management System based on .NET Core and React -
Database scaffolding platform
Database scaffolding tool -
MicroBootstrap
A Full Stack framework written in .NET Core to speed up your development process in microservices and modular monolith apps. It gathers most widely used frameworks in .NET world and pack them into a simple bootstrap package. -
Mvc5
A Template For AspNet MVC5 With GroupBase Authorization -
HopFramework
Domain Driven Design, Microservices, .Net 5. -
Plastic
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. -
Simplify.Web
Simplify.Web is an open-source, lightweight, fast and highly customizable server-side .NET web-framework based on MVC and OWIN for building HTTP based web-applications, RESTful APIs etc. -
MVCExtensibleRoleManagement
ASP.NET MVC Role-Based Security Example -
Ether.Network
Ether.Network is an open source networking library that allow developers to create simple, fast and scalable socket server or client applications over the TCP/IP protocol.
Collect and Analyze Billions of Data Points in Real Time
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of PersianDataAnnotations or a related project?
README
Persian DataAnnotations
Persian DataAnnotations as DataAnnotations localizer library, is a localization of System.ComponentModel.DataAnnotations for Persian (Farsi) language. It's useful for Persian ASP.NET Core MVC & ASP.NET MVC based applications. The localization of built-in resource of DataAnnotations is a bit hard to work (specialy in ASP.NET MVC) and this library helps your project for localization error messages just with single call a method. Fork
and Translate
RESX resources for your language ;-)
🌟 If you ❤️ library, please star it! 🌟
اعتبار سنجی کنترل ها در .NET با Data Annotation ها
استفاده از DataAnnotation
ها و افزودن [Required]
یا [DataType(DataType.Password)]
یا دیگر Attribute
ها، کار اعتبارسنجی سمت کلاینت را بسیار ساده کرده است. برای فارسی سازی مقادیر پیش فرض کافی است این کتابخانه را با استفاده نیوگت / NuGet یا به صورت دستی به پروژه اضافه کنید.
شیوه استفاده در ASP.NET Core MVC
1- با استفاده از نیوگت / NuGet به سادگی می توانید این کتابخانه را به پروژه خود اضافه کنید
PM> Install-Package PersianDataAnnotationsCore
2- فقط همین یک خط را اضافه کنید و کار تمام میشود
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(options => options.ModelMetadataDetailsProviders.Add(new PersianDataAnnotationsCore.PersianValidationMetadataProvider()));
}
شیوه استفاده در ASP.NET MVC
1- با استفاده از نیوگت / NuGet به سادگی می توانید این کتابخانه را به پروژه خود اضافه کنید
PM> Install-Package PersianDataAnnotations -Version
2- یعنی فقط همین یک خط را اضافه کنید و کار تمام میشود
protected void Application_Start()
{
PersianDataAnnotations.PersianDataAnnotations.Register();
}
3- فارسی سازی خطاهای مربوط به رمز عبور و قسمت ثبت نام
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
{
...
manager.PasswordValidator = new PasswordValidator
/// جایگزین شود با خط زیر
manager.PasswordValidator = new PersianPasswordValidator
...
}
دمو
برای مشاهده دمو می توانید به فرم عضویت یا ورود کاربران در طراحی وب ایران مراجعه کنید
نمونه فارسی سازی خطاهای مربوط به رمز عبور
ترجمه
هنوز احتمال دارد که خطاهایی فارسی نشده باشند. در نسخه های مربوط به پروژه های ASP.NET MVC یک متد استاتیک ترجمه نظیر به نظیر خطا هم اضافه شده که خطاها را می تواند قبل از نمایش تا حد امکان ترجمه کند.
private void AddErrors(IdentityResult result)
{
foreach (var error in result.Errors)
{
ModelState.AddModelError("", PersianDataAnnotations.TranslateError.Translate(error));
}
}
متد بالا در کلاس های پیش فرض AccountController یا مشابه آن وجود دارد فقط به آن ترجمه متن خطا اضافه شده است
البته مشابه این متد استاتیک برای نسخه های ASP.NET Core MVC هم ارائه شده است
var result = PersianDataAnnotationsCore.PersianValidationMetadataProvider.ToPersian(value)
نکات
- امکان تغییر
Resource
برای جلوگیری از تکرارErrorMessageResourceType
در هنگامRegisterAdapters
دیده شده است - با جستجوی عنوان پروژه در
NuGet
می توانید از ابزارNuGet
در ویژوال استودیو استفاده کنید و کتابخانه را به سادگی به پروژه اضافه کنید - سعی شده نقطه از آخر پیام ها حذف شود برای انطباق بیشتر با برنامه های چپ به راست
- سعی شده پیام ها با فارسی روان نه پارسی بسیار ادبی و دور از ادبیات عامه بیان شود
- سعی شده از بیشتر از است به جای مصدر نادرست باشیدن استفاده شود
پشتیبانی
لطفا اگر ترجمه بهتری برای یک عبارت یافته اید لطفا اگر مشکلی مشاهده کردید لطفا اگر پیشنهادی دارید
- یا Fork & Pull کنید
- یا Share Issue کنید
- یا لااقل یه تلفن یا موبایل بزنید به طراحی وب ایران
License
The project is dedicated to public and is free for all uses, commercial or otherwise. Supported by Web Design Iran
این پروژه تحت حمایت طراحی وب ایران بوده و برای استفاده تجاری یا غیر تجاری، رایگان است
*Note that all licence references and agreements mentioned in the PersianDataAnnotations README section above
are relevant to that project's source code only.