-
-
Notifications
You must be signed in to change notification settings - Fork 103
support chinese language #42
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
80879c0
support chinese language
566eef1
Update demo/RulesEngineEditorWebAssembly/Program.cs
alexreich 7e4c20e
Update src/RulesEngineEditor/Resources/SharedResources.Designer.cs
alexreich 8e57987
localization fixes
alexreich f422002
merge fixes
alexreich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| window.blazorCulture = { | ||
| get: function () { | ||
| return window.localStorage['BlazorCulture']; | ||
| }, | ||
| set: function (value) { | ||
| window.localStorage['BlazorCulture'] = value; | ||
| } | ||
| }; | ||
|
|
||
| window.setCultureCookie = function (culture) { | ||
| var cookieValue = 'c=' + culture + '|uic=' + culture; | ||
| var secure = (location.protocol === 'https:') ? '; secure' : ''; | ||
| document.cookie = '.AspNetCore.Culture=' + cookieValue + '; path=/; samesite=lax' + secure; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,29 @@ | ||
| @* | ||
| @* | ||
| // Copyright (c) Alex Reich. | ||
| // Licensed under the CC BY 4.0 License. | ||
| *@ | ||
| @using RulesEngineEditor.Resources | ||
| <div> | ||
| <ul class="nav flex-column"> | ||
| <li class="nav-item px-3"> | ||
| <NavLink class="nav-link" href="" Match="NavLinkMatch.All"> | ||
| <span class="oi oi-home" aria-hidden="true"></span> Home | ||
| <span class="oi oi-home" aria-hidden="true"></span> @RulesEngineEditor.Resources.SharedResources.Home | ||
| </NavLink> | ||
| </li> | ||
| <li class="nav-item px-3"> | ||
| <NavLink class="nav-link" href="demo"> | ||
| <span class="oi oi-book" aria-hidden="true"></span> Demo | ||
| <span class="oi oi-book" aria-hidden="true"></span> @RulesEngineEditor.Resources.SharedResources.Demo | ||
| </NavLink> | ||
| </li> | ||
| <li class="nav-item px-3"> | ||
| <NavLink class="nav-link" href="new"> | ||
| <span class="oi oi-aperture" aria-hidden="true"></span> New | ||
| <span class="oi oi-aperture" aria-hidden="true"></span> @RulesEngineEditor.Resources.SharedResources.New | ||
| </NavLink> | ||
| </li> | ||
| <li class="nav-item px-3"> | ||
| <NavLink class="nav-link" href="standalone"> | ||
| <span class="oi oi-fullscreen-enter" aria-hidden="true"></span> Standalone | ||
| <span class="oi oi-fullscreen-enter" aria-hidden="true"></span> @RulesEngineEditor.Resources.SharedResources.Standalone | ||
| </NavLink> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| window.blazorCulture = { | ||
| get: function () { | ||
| return window.localStorage['BlazorCulture']; | ||
| }, | ||
| set: function (value) { | ||
| window.localStorage['BlazorCulture'] = value; | ||
| } | ||
| }; | ||
|
|
||
| window.setCultureCookie = function (culture) { | ||
| var cookieValue = 'c=' + culture + '|uic=' + culture; | ||
| var secure = (location.protocol === 'https:') ? '; secure' : ''; | ||
| document.cookie = '.AspNetCore.Culture=' + cookieValue + '; path=/; samesite=lax' + secure; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| @using Microsoft.JSInterop | ||
| @inject IJSRuntime JS | ||
| @inject NavigationManager Nav | ||
| @code { | ||
| private string selectedCulture = System.Globalization.CultureInfo.CurrentUICulture.Name; | ||
| private async Task OnChange(ChangeEventArgs e) | ||
| { | ||
| selectedCulture = e.Value?.ToString() ?? "en-US"; | ||
| try | ||
| { | ||
| await JS.InvokeVoidAsync("blazorCulture.set", selectedCulture); | ||
| await JS.InvokeVoidAsync("setCultureCookie", selectedCulture); | ||
| } | ||
| catch (JSException) | ||
| { | ||
| // If the culture.js script or functions are unavailable, ignore and continue. | ||
| } | ||
| catch (Exception) | ||
| { | ||
| // Swallow unexpected errors from JS interop to avoid breaking navigation. | ||
| } | ||
| Nav.NavigateTo(Nav.Uri, forceLoad: true); | ||
| } | ||
| } | ||
| <select class="form-select form-select-sm" value="@selectedCulture" @onchange="OnChange" style="min-width:120px" aria-label="Select Language"> | ||
| <option value="en-US">English</option> | ||
| <option value="zh-CN">中文(简体)</option> | ||
|
|
||
| </select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.