- Notifications
You must be signed in to change notification settings - Fork13
🌏 Database Resource Localization for .NET Core with Entity Framework and In Memory Cache
License
NotificationsYou must be signed in to change notification settings
NetCoreStack/Localization
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Online Demo Page:http://netcorestack-localization-test.herokuapp.com/
Latest release on Nuget:https://www.nuget.org/packages/NetCoreStack.Localization
Docker Image:https://hub.docker.com/r/tahaipek/netcorestack-localization-test-hosting
PM> docker pull tahaipek/netcorestack-localization-test-hostingPM> docker run -d -p 5003:80 netcorestack-localization-test-hosting
- .NET Core 2.1 or later
- SQLite or MsSQL Server
PM> Install-Package NetCoreStack.Localization
- .NET Core Resources in MsSql Server
- Injectable .NET Core StringLocalizers
- Serve Resources to JavaScript as JSON
- Directly access and manage Languages/Resources with api and code
Configuration settings inAppSettings.json
:
{"DbSettings": {"SqlConnectionString":"Server=.;Database=LocalizationTest;Trusted_Connection=True;MultipleActiveResultSets=true"},"LocalizationSettings": {"UseDefaultLanguageWhenValueIsNull":true }}
publicvoidConfigureServices(IServiceCollectionservices){services.AddNetCoreStackMvc(options=>{options.AppName="NetCoreStack Localization";});services.AddNetCoreStackLocalization(Configuration);}
publicvoidConfigure(IApplicationBuilderapp,IHostingEnvironmentenv){app.UseNetCoreStackMvc();app.UseNetCoreStackLocalization();}
<head><!-- Optional: The resources defined javascript. => "window.culture.resource" --><netcorestack-javascriptregistrar></netcorestack-javascriptregistrar><!--Optional: - If you want cookies to be set by JavaScript, you should use this. - If you don't want cookies to be set by JavaScript, remove this line. It will automatically redirect to Controller Action.--><netcorestack-languageSelector-scripts></netcorestack-languageSelector-scripts></head><body><!--Required: Language Selector ComboboxOptional: - If you want cookies to be set by JavaScript, you should set "set-cookie-with-java-script" property. - If you don't want cookies to be set by JavaScript, the application sets it through Controller Action.--><netcorestack-languageSelectorname="culture"set-cookie-with-java-script="true"></netcorestack-languageSelector>@Localizer["Logo_Description"]</body>
publicclassHomeController:Controller{privatereadonlyIStringLocalizer_stringLocalizer;publicHomeController(IStringLocalizerstringLocalizer){_stringLocalizer=stringLocalizer;}publicIActionResultAbout(){ViewData["Message"]=_stringLocalizer["AboutPageDescription"];returnView();}}
How To Use | Forms & Validations |
---|---|
![]() | ![]() |
Component Api | Client-Side Localization |
---|---|
![]() | ![]() |
Exception Localization | AjaxException Localization |
---|---|
![]() | ![]() |
About
🌏 Database Resource Localization for .NET Core with Entity Framework and In Memory Cache
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.