Skip to content

Add Chinese (zh-CN) translation , and update LocalizedString => GetAllStrings #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
},
"profiles": {
"DotNetEd.CoreAdmin.DemoAppDotNet6": {
"DotNetEd.CoreAdmin.DemoAppDotNet8": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
Expand Down
6 changes: 3 additions & 3 deletions src/DotNetEd.CoreAdmin/JsonLocalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public JsonLocalizer(IHttpContextAccessor httpContextAccessor)

public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)
{
var cultureKeys = httpContextAccessor.HttpContext.Request.Headers["Accept-Language"];

foreach(var culture in cultureKeys)
//var cultureKeys = httpContextAccessor.HttpContext.Request.Headers["Accept-Language"];
var cultureKeys = httpContextAccessor.HttpContext.Request.GetTypedHeaders().AcceptLanguage;
foreach (var culture in cultureKeys)
{
var fileName = $"{culture}.json";
var key = translations.Keys.FirstOrDefault(k => k.EndsWith(fileName));
Expand Down
13 changes: 13 additions & 0 deletions src/DotNetEd.CoreAdmin/Translations/zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Create": "创建",
"AccessDatabaseEntries": "访问左侧的数据库条目.",
"DevelopmentModeMessage": "您正在开发模式下运行。尚未在核心管理员上设置安全性。在设置安全性之前,核心管理员在非开发环境中将无法访问。请参阅中的文档 https://github.com/edandersen/core-admin.",
"CreateNew": "新建",
"GoBack": "返回",
"Edit": "编辑",
"Delete": "删除",
"DeleteConfirm": "是否确实要删除此?",
"Auto": "自动",
"Dark": "暗色",
"Light": "亮色"
}