{"id":13430701,"url":"https://github.com/NetCoreStack/Localization","last_synced_at":"2025-03-16T06:30:56.585Z","repository":{"id":97713906,"uuid":"132865632","full_name":"NetCoreStack/Localization","owner":"NetCoreStack","description":"🌏 Database Resource Localization for .NET Core with Entity Framework and In Memory Cache","archived":false,"fork":false,"pushed_at":"2019-01-06T23:52:18.000Z","size":1032,"stargazers_count":86,"open_issues_count":1,"forks_count":13,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-26T22:33:15.591Z","etag":null,"topics":["entity-framework","entity-framework-core","globalization-and-localization","localization","localization-management","net","netcore"],"latest_commit_sha":null,"homepage":"https://netcorestack.github.io/Localization/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetCoreStack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-10T07:38:12.000Z","updated_at":"2024-02-13T22:53:59.000Z","dependencies_parsed_at":"2023-06-02T22:00:34.632Z","dependency_job_id":null,"html_url":"https://github.com/NetCoreStack/Localization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetCoreStack%2FLocalization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetCoreStack%2FLocalization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetCoreStack%2FLocalization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetCoreStack%2FLocalization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetCoreStack","download_url":"https://codeload.github.com/NetCoreStack/Localization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221656331,"owners_count":16858745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["entity-framework","entity-framework-core","globalization-and-localization","localization","localization-management","net","netcore"],"created_at":"2024-07-31T02:00:56.921Z","updated_at":"2024-10-27T09:30:35.423Z","avatar_url":"https://github.com/NetCoreStack.png","language":"C#","readme":"# NetCoreStack Localization v1.0.6\n## Database Resource Localization for .NET Core with Entity Framework and In Memory Cache\n[![NuGet](https://img.shields.io/nuget/v/NetCoreStack.Localization.svg?longCache=true\u0026style=flat-square)](https://www.nuget.org/packages/NetCoreStack.Localization)\n[![NuGet](https://img.shields.io/nuget/dt/NetCoreStack.Localization.svg?longCache=true\u0026style=flat-square)](https://www.nuget.org/packages/NetCoreStack.Localization)\n\n## Links\n* **Online Demo Page:** [http://netcorestack-localization-test.herokuapp.com/](http://netcorestack-localization-test.herokuapp.com/)\n\n* **Docs:** [https://netcorestack.github.io/Localization/](https://netcorestack.github.io/Localization/)\n\n* **Latest release on Nuget:** [https://www.nuget.org/packages/NetCoreStack.Localization](https://www.nuget.org/packages/NetCoreStack.Localization)\n\n* **Docker Image:** [https://hub.docker.com/r/tahaipek/netcorestack-localization-test-hosting](https://hub.docker.com/r/tahaipek/netcorestack-localization-test-hosting)\n\n\n## Docker File\n```\nPM\u003e docker pull tahaipek/netcorestack-localization-test-hosting\nPM\u003e docker run -d -p 5003:80 netcorestack-localization-test-hosting\n```\n\n## Requirements:\n* .NET Core 2.1 or later\n* SQLite or MsSQL Server\n\n### Install for .NET Core\n```\nPM\u003e Install-Package NetCoreStack.Localization\n```\n\n## Features\n* .NET Core Resources in MsSql Server\n* Injectable .NET Core StringLocalizers\n* Serve Resources to JavaScript as JSON\n* Directly access and manage Languages/Resources with api and code\n\n\n## Installation\n### **AppSettings Configuration**\nConfiguration settings in `AppSettings.json`:\n```json\n{\n\t\"DbSettings\": {\n\t\t\"SqlConnectionString\": \"Server=.;Database=LocalizationTest;Trusted_Connection=True;MultipleActiveResultSets=true\"\n\t},\n\t\"LocalizationSettings\": {\n\t\t\"UseDefaultLanguageWhenValueIsNull\": true\n  \t}\n}\n```\n### **Enable NetCoreStack.Localization in ASP.NET Core**\n```csharp\npublic void ConfigureServices(IServiceCollection services)\n{\n\tservices.AddNetCoreStackMvc(options =\u003e { options.AppName = \"NetCoreStack Localization\"; });\n\tservices.AddNetCoreStackLocalization(Configuration);\n}\n```\n\n```csharp\npublic void Configure(IApplicationBuilder app, IHostingEnvironment env)\n{\n\tapp.UseNetCoreStackMvc();\n\tapp.UseNetCoreStackLocalization();\n}\n```\n\n\n### **Client-side localization in \\*.cshtml file**\n```html\n\u003chead\u003e\n\t\u003c!-- Optional: The resources defined javascript. =\u003e  \"window.culture.resource\"  --\u003e\n\t\u003cnetcorestack-javascriptregistrar\u003e\u003c/netcorestack-javascriptregistrar\u003e\n    \n\t\u003c!-- \n\tOptional: \n\t   - If you want cookies to be set by JavaScript, you should use this.   \n\t   - If you don't want cookies to be set by JavaScript, remove this line. It will automatically redirect to Controller Action.\n\t--\u003e\n\t\u003cnetcorestack-languageSelector-scripts\u003e\u003c/netcorestack-languageSelector-scripts\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\t\u003c!--  \n\tRequired: Language Selector Combobox\n\tOptional:\n\t   - If you want cookies to be set by JavaScript, you should set \"set-cookie-with-java-script\" property.   \n\t   - If you don't want cookies to be set by JavaScript, the application sets it through Controller Action.\n\t--\u003e\n\t\u003cnetcorestack-languageSelector name=\"culture\" set-cookie-with-java-script=\"true\"\u003e\u003c/netcorestack-languageSelector\u003e\n\t\n\t@Localizer[\"Logo_Description\"]\n\u003c/body\u003e\n```\n\n### **Back-end Localization in \\*.cs file**\n```csharp \npublic class HomeController : Controller\n{\n\tprivate readonly IStringLocalizer _stringLocalizer;\n\tpublic HomeController(IStringLocalizer stringLocalizer)\n\t{\n\t\t_stringLocalizer = stringLocalizer;\n\t}\n\n\tpublic IActionResult About()\n\t{\n\t\tViewData[\"Message\"] = _stringLocalizer[\"AboutPageDescription\"];\n\t\treturn View();\n\t}\n}\n```\n\n\n### **Test Project Preview**\n\n| How To Use  | Forms \u0026 Validations|\n| ------------- | ------------- |\n| \u003ca href=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_01.png?raw=true\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_01.png?raw=true\" align=\"center\" width=\"90%\" \u003e\u003c/a\u003e  | \u003ca href=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_02.png?raw=true\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_02.png?raw=true\" align=\"center\" width=\"90%\" \u003e\u003c/a\u003e  |\n\n\n| Component Api  | Client-Side Localization|\n| ------------- | ------------- |\n| \u003ca href=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_03.png?raw=true\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_03.png?raw=true\" align=\"center\" width=\"90%\" \u003e\u003c/a\u003e  | \u003ca href=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_06.png?raw=true\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_06.png?raw=true\" align=\"center\" width=\"90%\" \u003e\u003c/a\u003e  |\n\n\n| Exception Localization  | AjaxException Localization |\n| ------------- | ------------- |\n| \u003ca href=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_05.png?raw=true\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_05.png?raw=true\" align=\"center\" width=\"90%\" \u003e\u003c/a\u003e  | \u003ca href=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_04.png?raw=true\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/NetCoreStack/Localization/blob/master/Sample_04.png?raw=true\" align=\"center\" width=\"90%\" \u003e\u003c/a\u003e  |\n\n\n\n\n---------\n#### .Net Core Localization\n#### .Net Core Localization with Entity Framework\n#### .Net Core Database Localization\n","funding_links":[],"categories":["Frameworks, Libraries and Tools","框架, 库和工具","C# #"],"sub_categories":["Internationalization","国际化"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetCoreStack%2FLocalization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNetCoreStack%2FLocalization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetCoreStack%2FLocalization/lists"}