├── .gitignore ├── Example └── BlazorWasmMultiLanguages │ ├── BlazorWasmMultiLanguages.sln │ └── BlazorWasmMultiLanguages │ ├── App.razor │ ├── BlazorWasmMultiLanguages.csproj │ ├── Pages │ ├── Counter.razor │ ├── FetchData.razor │ └── Index.razor │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Resources │ ├── ar-SA.yml │ ├── bg-BG.yml │ ├── ca-ES.yml │ ├── de-DE.yml │ ├── en-US.yml │ ├── fi-FI.yml │ ├── fr-FR.yml │ ├── it-IT.yml │ ├── ja-JP.yml │ └── ml-IN.yml │ ├── Shared │ ├── MainLayout.razor │ ├── NavMenu.razor │ └── SurveyPrompt.razor │ ├── TestFolder │ ├── ar-SA.yml │ ├── bg-BG.yml │ ├── ca-ES.yml │ ├── de-DE.yml │ ├── en-US.yml │ ├── fi-FI.yml │ ├── fr-FR.yml │ ├── it-IT.yml │ ├── ja-JP.yml │ └── ml-IN.yml │ ├── _Imports.razor │ └── wwwroot │ ├── German.png │ ├── Indian.png │ ├── Japan.png │ ├── css │ ├── bootstrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── open-iconic │ │ ├── FONT-LICENSE │ │ ├── ICON-LICENSE │ │ ├── README.md │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ └── site.css │ ├── de.png │ ├── es.png │ ├── fr.png │ ├── index.html │ ├── sample-data │ └── weather.json │ └── us.png ├── Images ├── Localization Library latest show.gif ├── Localization Library latest show │ └── Localization Library latest show.gif ├── MultiLanguages Benchamrking Results.png └── v6 │ ├── hierarchy-friendly.png │ ├── interpolation-support.png │ ├── source-generator.png │ └── yaml-based.png ├── LICENSE ├── README.md ├── azure-pipelines.yml ├── src ├── AKSoftware.Localization.MultiLanguages.Benchmarks │ ├── AKSoftware.Localization.MultiLanguages.Benchmarks.csproj │ ├── Program.cs │ └── Resources │ │ ├── ar-SA.yml │ │ ├── bg-BG.yml │ │ ├── ca-ES.yml │ │ ├── de-DE.yml │ │ ├── en-US.yml │ │ ├── fi-FI.yml │ │ ├── fr-FR.yml │ │ ├── it-IT.yml │ │ ├── ja-JP.yml │ │ └── ml-IN.yml ├── AKSoftware.Localization.MultiLanguages.Blazor │ ├── AKSoftware.Localization.MultiLanguages.Blazor.csproj │ ├── AkMultiLanguages.png │ ├── BlazorExtensions.cs │ ├── ComponentExtension.cs │ └── _Imports.razor ├── AKSoftware.Localization.MultiLanguages.SourceGenerator.Tests │ ├── AKSoftware.Localization.MultiLanguages.SourceGenerator.Tests.csproj │ ├── Resources │ │ └── en-US.yml │ └── en-US.yml ├── AKSoftware.Localization.MultiLanguages.SourceGenerator │ ├── AKSoftware.Localization.MultiLanguages.SourceGenerator.csproj │ ├── AkMultiLanguages.png │ ├── DependencyInjectionExtensions.cs │ ├── Docs │ │ └── README.md │ ├── GeneratorExtensions.cs │ ├── KeysAccessorSourceGenerator.cs │ ├── Properties │ │ └── launchSettings.json │ ├── StaticKeysSourceGenerator.cs │ └── build │ │ └── AKSoftware.Localization.MultiLanguages.SourceGenerator.props ├── AKSoftware.Localization.MultiLanguages.Tests │ ├── AKSoftware.Localization.MultiLanguages.Tests.csproj │ ├── CodeGeneratorTests │ │ ├── KeysAccessorGeneratorTests.cs │ │ ├── KeysGeneratorTestBase.cs │ │ └── StaticKeysGeneratorTests.cs │ ├── GenerateStaticKeysServiceTests.cs │ ├── LanguageContainerWithFolderKeysProviderTests.cs │ ├── LanguagesContainerWithEmbeddedKeysProviderTests.cs │ ├── MyEnum.cs │ ├── ParseCodeLogicTests.cs │ ├── Resources │ │ ├── ar-SA.yml │ │ ├── bg-BG.yml │ │ ├── ca-ES.yml │ │ ├── de-DE.yml │ │ ├── en-US.yml │ │ ├── fi-FI.yml │ │ ├── fr-FR.yml │ │ ├── it-IT.yml │ │ ├── ja-JP.yml │ │ └── ml-IN.yml │ ├── TestClasses │ │ └── Customer.cs │ ├── TestHelper.cs │ ├── ValidationLocalizationTests.cs │ └── VerifyLocalization.cs ├── AKSoftware.Localization.MultiLanguages.UWP │ ├── AKSoftware.Localization.MultiLanguages.UWP.csproj │ ├── AKSoftware.Localization.MultiLanguages.UWP.nuspec │ ├── AkMultiLanguages.png │ ├── Behaviors │ │ ├── DependencyObjectCollection.cs │ │ ├── MultiBindingBehavior.cs │ │ ├── MultiBindingItem.cs │ │ └── MultiBindingItemCollection.cs │ ├── Converters │ │ ├── LocalizationConverter.cs │ │ └── MultiValueConverterBase.cs │ ├── Extensions │ │ ├── LanguageServiceExtension.cs │ │ └── LocalizeStringExtension.cs │ ├── ExternalFileKeysProvider.cs │ ├── IServiceProviderHost.cs │ ├── LocalizationService.cs │ └── Properties │ │ ├── AKSoftware.Localization.MultiLanguages.UWP.rd.xml │ │ └── AssemblyInfo.cs ├── AKSoftware.Localization.MultiLanguages.sln ├── AKSoftware.Localization.MultiLanguages │ ├── AKSoftware.Localization.MultiLanguages.csproj │ ├── AkMultiLanguages.png │ ├── CodeGeneration │ │ ├── CodeGenerationExtensions.cs │ │ ├── CreateCodeLogic.cs │ │ ├── GenerateStaticKeysService.cs │ │ ├── IGenerateKeysService.cs │ │ ├── KeysAccessorGenerator.cs │ │ └── StaticKeysGenerator.cs │ ├── DataAttributeParsing.cs │ ├── Docs │ │ └── README.md │ ├── IExtension.cs │ ├── ILanguageContainerService.cs │ ├── KeyValueEnumerator.cs │ ├── Keys.cs │ ├── LanguageContainer.cs │ ├── LanguageContainerInAssembly.cs │ ├── LanguageContainerOptions.cs │ ├── LocalizationFolderType.cs │ ├── ParseCodeLogic.cs │ ├── ParseParms.cs │ ├── ParseResult.cs │ ├── Providers │ │ ├── BaseKeysProvider.cs │ │ ├── EmbeddedResourceKeysProvider.cs │ │ ├── FolderResourceKeysProvider.cs │ │ └── IKeysProvider.cs │ ├── ServiceExtensions.cs │ ├── StringUtil.cs │ └── ValidationLocalization.cs ├── BlazorAKLocalization │ ├── App.razor │ ├── BlazorAKLocalization.csproj │ ├── Pages │ │ ├── Counter.razor │ │ ├── FetchData.razor │ │ └── Index.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Resources │ │ ├── ar-SA.yml │ │ ├── bg-BG.yml │ │ ├── ca-ES.yml │ │ ├── de-DE.yml │ │ ├── en-US.yml │ │ ├── fi-FI.yml │ │ ├── fr-FR.yml │ │ ├── it-IT.yml │ │ ├── ja-JP.yml │ │ └── ml-IN.yml │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ ├── NavMenu.razor.css │ │ └── SurveyPrompt.razor │ ├── _Imports.razor │ └── wwwroot │ │ ├── css │ │ ├── app.css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ │ ├── favicon.ico │ │ ├── index.html │ │ └── sample-data │ │ └── weather.json ├── BlazorServerLocalizationSample │ ├── App.razor │ ├── BlazorServerLocalizationSample.csproj │ ├── Data │ │ ├── WeatherForecast.cs │ │ └── WeatherForecastService.cs │ ├── Pages │ │ ├── Counter.razor │ │ ├── Error.cshtml │ │ ├── Error.cshtml.cs │ │ ├── FetchData.razor │ │ ├── Index.razor │ │ ├── _Host.cshtml │ │ └── _Layout.cshtml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Resources │ │ ├── ar-SA.yml │ │ ├── bg-BG.yml │ │ ├── ca-ES.yml │ │ ├── de-DE.yml │ │ ├── en-US.yml │ │ ├── fi-FI.yml │ │ ├── fr-FR.yml │ │ ├── it-IT.yml │ │ ├── ja-JP.yml │ │ └── ml-IN.yml │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ ├── NavMenu.razor.css │ │ └── SurveyPrompt.razor │ ├── _Imports.razor │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ │ ├── css │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ └── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.svg │ │ │ │ ├── open-iconic.ttf │ │ │ │ └── open-iconic.woff │ │ └── site.css │ │ └── favicon.ico ├── ConsoleAppSample │ ├── ConsoleAppSample.csproj │ ├── Program.cs │ └── Resources │ │ ├── ar-SA.yml │ │ ├── bg-BG.yml │ │ ├── ca-ES.yml │ │ ├── de-DE.yml │ │ ├── en-US.yml │ │ ├── fi-FI.yml │ │ ├── fr-FR.yml │ │ ├── it-IT.yml │ │ ├── ja-JP.yml │ │ └── ml-IN.yml ├── TestProject1 │ ├── TestProject1.csproj │ ├── UnitTest1.cs │ └── Usings.cs └── UwpAkLocalization │ ├── App.xaml │ ├── App.xaml.cs │ ├── ApplicationResourceLoader.cs │ ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ ├── Wide310x150Logo.scale-200.png │ ├── ar-SA.png │ ├── bg-BG.png │ ├── ca-ES.png │ ├── de-DE.png │ ├── en-US.png │ ├── fi-FI.png │ ├── fr-FR.png │ ├── it-IT.png │ ├── ja-JP.png │ └── ml-IN.png │ ├── LocalizationKeys.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml │ ├── Resources │ ├── ar-SA.yml │ ├── bg-BG.yml │ ├── ca-ES.yml │ ├── de-DE.yml │ ├── en-US.yml │ ├── fi-FI.yml │ ├── fr-FR.yml │ ├── it-IT.yml │ ├── ja-JP.yml │ └── ml-IN.yml │ └── UwpAkLocalization.csproj └── tests └── AKSoftware.Localization.MultiLanguages.UWP.Tests ├── AKSoftware.Localization.MultiLanguages.UWP.Tests.csproj ├── Assets ├── LockScreenLogo.scale-200.png ├── SplashScreen.scale-200.png ├── Square150x150Logo.scale-200.png ├── Square44x44Logo.scale-200.png ├── Square44x44Logo.targetsize-24_altform-unplated.png ├── StoreLogo.png └── Wide310x150Logo.scale-200.png ├── EmbeddedResourceKeysProviderTests.cs ├── ExternalFileKeysProviderTests.cs ├── Package.appxmanifest ├── Properties ├── AssemblyInfo.cs └── Default.rd.xml ├── Resources ├── ar-SA.yml ├── bg-BG.yml ├── ca-ES.yml ├── de-DE.yml ├── en-US.yml ├── fi-FI.yml ├── fr-FR.yml ├── it-IT.yml ├── ja-JP.yml └── ml-IN.yml ├── TestBase.cs ├── UnitTestApp.xaml └── UnitTestApp.xaml.cs /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29709.97 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWasmMultiLanguages", "BlazorWasmMultiLanguages\BlazorWasmMultiLanguages.csproj", "{933F799A-62E7-4EA0-A50C-18BF4A866F0F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {933F799A-62E7-4EA0-A50C-18BF4A866F0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {933F799A-62E7-4EA0-A50C-18BF4A866F0F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {933F799A-62E7-4EA0-A50C-18BF4A866F0F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {933F799A-62E7-4EA0-A50C-18BF4A866F0F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {EACBFD8F-28ED-4586-A02A-7A695D9D4EEB} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @inject ILanguageContainerService languageContainer 3 | 4 |

@languageContainer.Keys["Counter:Title"]

5 | 6 |

@languageContainer.Keys["Counter:Title"]: @currentCount

7 | 8 | 9 | 10 | @code { 11 | private int currentCount = 0; 12 | 13 | private void IncrementCount() 14 | { 15 | currentCount++; 16 | } 17 | 18 | 19 | protected override void OnInitialized() 20 | { 21 | languageContainer.InitLocalizedComponent(this); 22 | base.OnInitialized(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @inject HttpClient Http 3 | @inject ILanguageContainerService languageContainer 4 | 5 |

@languageContainer.Keys["FetchData:WeatherForcast"]

6 | 7 |

@languageContainer.Keys["FetchData:WeatherTitle"]

8 | 9 | @if (forecasts == null) 10 | { 11 |

@languageContainer.Keys["FetchData:Loading"]...

12 | } 13 | else 14 | { 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var forecast in forecasts) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 |
@languageContainer.Keys["FetchData:Date"]@languageContainer.Keys["FetchData:Temp"]. (C)@languageContainer.Keys["FetchData:Temp"]. (F)@languageContainer.Keys["FetchData:Summury"]
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
36 | } 37 | 38 | @code { 39 | private WeatherForecast[] forecasts; 40 | 41 | protected override async Task OnInitializedAsync() 42 | { 43 | languageContainer.InitLocalizedComponent(this); 44 | forecasts = await Http.GetFromJsonAsync("sample-data/weather.json"); 45 | } 46 | 47 | public class WeatherForecast 48 | { 49 | public DateTime Date { get; set; } 50 | 51 | public int TemperatureC { get; set; } 52 | 53 | public string Summary { get; set; } 54 | 55 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @inject ILanguageContainerService languageContainer 3 | 4 |

@languageContainer.Keys["HomePage:HelloWorld"]

5 | 6 | @languageContainer.Keys["HomePage:Welcome", new 7 | { 8 | username = "aksoftware98" 9 | }] 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | @code 27 | { 28 | void SetLanguage(string language) 29 | { 30 | languageContainer.SetLanguage(System.Globalization.CultureInfo.GetCultureInfo(language)); 31 | } 32 | 33 | protected override void OnInitialized() 34 | { 35 | languageContainer.InitLocalizedComponent(this); 36 | base.OnInitialized(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using System.Text; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using AKSoftware.Localization.MultiLanguages; 7 | using System.Reflection; 8 | using System.Globalization; 9 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 10 | using System.Net.Http; 11 | 12 | namespace BlazorWasmMultiLanguages 13 | { 14 | public class Program 15 | { 16 | public static async Task Main(string[] args) 17 | { 18 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 19 | builder.RootComponents.Add("app"); 20 | // Load the language container with files from the Resources Folder 21 | builder.Services.AddLanguageContainer(Assembly.GetExecutingAssembly()); 22 | 23 | // Load the language Container with the files from a custom folder 24 | //builder.Services.AddLanguageContainer(Assembly.GetExecutingAssembly(), folderName: "TestFolder"); 25 | 26 | builder.Services.AddScoped(); 27 | 28 | // Launch the app with a default culture 29 | //builder.Services.AddLangaugeContainer(Assembly.GetExecutingAssembly(), CultureInfo.GetCultureInfo("fr-Fr")); 30 | 31 | await builder.Build().RunAsync(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:59916/", 7 | "sslPort": 44356 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazorWasmMultiLanguages": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا {username} في التجربة 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Counter: 9 | Title: مكافحه 10 | ClickMe: انقر فوق Me 11 | FetchData: 12 | Title: جلب البيانات 13 | WeatherForcast: توقعات الطقس 14 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 15 | Loading: تحميل 16 | Date: تاريخ 17 | Temp: Temp 18 | Summary: موجز 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли {username} на теста 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Counter: 9 | Title: Counter 10 | ClickMe: Кликнете върху мен 11 | FetchData: 12 | Title: Извличане на данни 13 | WeatherForcast: Прогноза за времето 14 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 15 | Loading: Зареждане 16 | Date: Дата 17 | Temp: Temp 18 | Summary: Резюме 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Bienvenida {username} a la prueba 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Counter: 9 | Title: Taulell 10 | ClickMe: Feu clic a mi 11 | FetchData: 12 | Title: Obtén dades 13 | WeatherForcast: Previsió 14 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 15 | Loading: Càrrega 16 | Date: Data 17 | Temp: Temp 18 | Summary: Resum 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen {username} zum Test 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Counter: 9 | Title: Zähler 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Abrufen von Daten 13 | WeatherForcast: Wettervorhersage 14 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 15 | Loading: Laden 16 | Date: Datum 17 | Temp: Temp 18 | Summary: Zusammenfassung 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome {username} to the test 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Counter: 9 | Title: Counter 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Fetch Data 13 | WeatherForcast: Weather forecast 14 | WeatherTitle: This component demonstrates fetching data from the server 15 | Loading: Loading 16 | Date: Date 17 | Temp: Temp 18 | Summary: Summary 19 | 20 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa {username} testiin 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Counter: 9 | Title: Laskuri 10 | ClickMe: Valitse Minä 11 | FetchData: 12 | Title: Hae tiedot 13 | WeatherForcast: Ennuste 14 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 15 | Loading: Lastaus 16 | Date: Päivämäärä 17 | Temp: Temp 18 | Summary: Yhteenveto 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue {username} au test 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Counter: 9 | Title: Counter 10 | ClickMe: Cliquez sur moi 11 | FetchData: 12 | Title: Rechercher des données 13 | WeatherForcast: Prévisions météo 14 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 15 | Loading: Chargement 16 | Date: Date 17 | Temp: Temp 18 | Summary: Résumé 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto {username} per il test 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Counter: 9 | Title: Contatore 10 | ClickMe: Fare clic su Me 11 | FetchData: 12 | Title: Recupera dati 13 | WeatherForcast: Previsioni meteo 14 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 15 | Loading: Caricamento 16 | Date: Data 17 | Temp: Temp 18 | Summary: Riepilogo 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: テストする{username}へようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Counter: 9 | Title: カウンター 10 | ClickMe: '[私] をクリックします。' 11 | FetchData: 12 | Title: データのフェッチ 13 | WeatherForcast: 天気予報 14 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 15 | Loading: 読み込み 16 | Date: 日付 17 | Temp: 温度 18 | Summary: 概要 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: परीक्षण करने के लिए आपका स्वागत है {username} 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Counter: 9 | Title: à ́à μà 10 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 11 | FetchData: 12 | Title: ഡാറ്റ കൊണ്ടുവരിക 13 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 14 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 15 | Loading: ലഭ്യമാക്കുന്നു 16 | Date: തീയതി 17 | Temp: à ́à μà 18 | Summary: സംഗ്രഹം 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | @inject ILanguageContainerService languageContainer 2 | 3 | 9 | 10 |
11 | 28 |
29 | 30 | @code { 31 | private bool collapseNavMenu = true; 32 | 33 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 34 | 35 | private void ToggleNavMenu() 36 | { 37 | collapseNavMenu = !collapseNavMenu; 38 | } 39 | 40 | protected override void OnInitialized() 41 | { 42 | languageContainer.InitLocalizedComponent(this); 43 | base.OnInitialized(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | @inject ILanguageContainerService languageContainer 2 | 3 | 13 | 14 | @code { 15 | // Demonstrates how a parent component can supply parameters 16 | [Parameter] 17 | public string Title { get; set; } 18 | 19 | protected override void OnInitialized() 20 | { 21 | languageContainer.InitLocalizedComponent(this); 22 | base.OnInitialized(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Counter: 9 | Title: مكافحه 10 | ClickMe: انقر فوق Me 11 | FetchData: 12 | Title: جلب البيانات 13 | WeatherForcast: توقعات الطقس 14 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 15 | Loading: تحميل 16 | Date: تاريخ 17 | Temp: Temp 18 | Summary: موجز 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Counter: 9 | Title: Counter 10 | ClickMe: Кликнете върху мен 11 | FetchData: 12 | Title: Извличане на данни 13 | WeatherForcast: Прогноза за времето 14 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 15 | Loading: Зареждане 16 | Date: Дата 17 | Temp: Temp 18 | Summary: Резюме 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Benvingut 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Counter: 9 | Title: Taulell 10 | ClickMe: Feu clic a mi 11 | FetchData: 12 | Title: Obtén dades 13 | WeatherForcast: Previsió 14 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 15 | Loading: Càrrega 16 | Date: Data 17 | Temp: Temp 18 | Summary: Resum 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Counter: 9 | Title: Zähler 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Abrufen von Daten 13 | WeatherForcast: Wettervorhersage 14 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 15 | Loading: Laden 16 | Date: Datum 17 | Temp: Temp 18 | Summary: Zusammenfassung 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Counter: 9 | Title: Counter 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Fetch Data 13 | WeatherForcast: Weather forecast 14 | WeatherTitle: This component demonstrates fetching data from the server 15 | Loading: Loading 16 | Date: Date 17 | Temp: Temp 18 | Summary: Summary 19 | 20 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Counter: 9 | Title: Laskuri 10 | ClickMe: Valitse Minä 11 | FetchData: 12 | Title: Hae tiedot 13 | WeatherForcast: Ennuste 14 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 15 | Loading: Lastaus 16 | Date: Päivämäärä 17 | Temp: Temp 18 | Summary: Yhteenveto 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Counter: 9 | Title: Counter 10 | ClickMe: Cliquez sur moi 11 | FetchData: 12 | Title: Rechercher des données 13 | WeatherForcast: Prévisions météo 14 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 15 | Loading: Chargement 16 | Date: Date 17 | Temp: Temp 18 | Summary: Résumé 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Counter: 9 | Title: Contatore 10 | ClickMe: Fare clic su Me 11 | FetchData: 12 | Title: Recupera dati 13 | WeatherForcast: Previsioni meteo 14 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 15 | Loading: Caricamento 16 | Date: Data 17 | Temp: Temp 18 | Summary: Riepilogo 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: ようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Counter: 9 | Title: カウンター 10 | ClickMe: '[私] をクリックします。' 11 | FetchData: 12 | Title: データのフェッチ 13 | WeatherForcast: 天気予報 14 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 15 | Loading: 読み込み 16 | Date: 日付 17 | Temp: 温度 18 | Summary: 概要 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/TestFolder/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: സ്വാഗതം 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Counter: 9 | Title: à ́à μà 10 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 11 | FetchData: 12 | Title: ഡാറ്റ കൊണ്ടുവരിക 13 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 14 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 15 | Loading: ലഭ്യമാക്കുന്നു 16 | Date: തീയതി 17 | Temp: à ́à μà 18 | Summary: സംഗ്രഹം 19 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.JSInterop 7 | @using BlazorWasmMultiLanguages 8 | @using BlazorWasmMultiLanguages.Shared 9 | @using AKSoftware.Localization.MultiLanguages 10 | @using AKSoftware.Localization.MultiLanguages.Blazor -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/German.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/German.png -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/Indian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/Indian.png -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/Japan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/Japan.png -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/de.png -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/es.png -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/fr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/fr.png -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | BlazorWasmMultiLanguages 8 | 9 | 10 | 11 | 12 | 13 | 14 | Loading... 15 | 16 |
17 | An unhandled error has occurred. 18 | Reload 19 | 🗙 20 |
21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/sample-data/weather.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2018-05-06", 4 | "temperatureC": 1, 5 | "summary": "Freezing", 6 | "temperatureF": 33 7 | }, 8 | { 9 | "date": "2018-05-07", 10 | "temperatureC": 14, 11 | "summary": "Bracing", 12 | "temperatureF": 57 13 | }, 14 | { 15 | "date": "2018-05-08", 16 | "temperatureC": -13, 17 | "summary": "Freezing", 18 | "temperatureF": 9 19 | }, 20 | { 21 | "date": "2018-05-09", 22 | "temperatureC": -16, 23 | "summary": "Balmy", 24 | "temperatureF": 4 25 | }, 26 | { 27 | "date": "2018-05-10", 28 | "temperatureC": -2, 29 | "summary": "Chilly", 30 | "temperatureF": 29 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Example/BlazorWasmMultiLanguages/BlazorWasmMultiLanguages/wwwroot/us.png -------------------------------------------------------------------------------- /Images/Localization Library latest show.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Images/Localization Library latest show.gif -------------------------------------------------------------------------------- /Images/Localization Library latest show/Localization Library latest show.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Images/Localization Library latest show/Localization Library latest show.gif -------------------------------------------------------------------------------- /Images/MultiLanguages Benchamrking Results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Images/MultiLanguages Benchamrking Results.png -------------------------------------------------------------------------------- /Images/v6/hierarchy-friendly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Images/v6/hierarchy-friendly.png -------------------------------------------------------------------------------- /Images/v6/interpolation-support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Images/v6/interpolation-support.png -------------------------------------------------------------------------------- /Images/v6/source-generator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Images/v6/source-generator.png -------------------------------------------------------------------------------- /Images/v6/yaml-based.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/Images/v6/yaml-based.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ahmad Mozaffar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | 2 | trigger: 3 | - master 4 | 5 | pool: 6 | vmImage: 'windows-latest' 7 | 8 | variables: 9 | solution: '**/AKSoftware.Localization.MultiLanguages.csproj' 10 | BuildConfiguration: 'Release' 11 | 12 | steps: 13 | - task: DotNetCoreCLI@2 14 | displayName: 'Restore packages' 15 | inputs: 16 | command: 'restore' 17 | projects: $(solution) 18 | feedsToUse: 'select' 19 | 20 | - task: DotNetCoreCLI@2 21 | displayName: 'Build the project' 22 | inputs: 23 | command: 'build' 24 | projects: '$(solution)' 25 | arguments: '--configuration $(BuildConfiguration)' 26 | 27 | - task: NDependTask@1 28 | displayName: 'NDepend Analyze' 29 | inputs: 30 | viewname: 'First Perspective' 31 | env: 32 | SYSTEM_ACCESSTOKEN: $(system.accesstoken) 33 | 34 | - task: DotNetCoreCLI@2 35 | displayName: 'Packing the library' 36 | inputs: 37 | command: 'pack' 38 | packagesToPack: '$(solution)' 39 | nobuild: true 40 | versioningScheme: 'byPrereleaseNumber' 41 | majorVersion: '1' 42 | minorVersion: '0' 43 | patchVersion: '0' 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/AKSoftware.Localization.MultiLanguages.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using AKSoftware.Localization.MultiLanguages; 3 | using AKSoftware.Localization.MultiLanguages.Providers; 4 | using BenchmarkDotNet.Attributes; 5 | using BenchmarkDotNet.Running; 6 | using System.Globalization; 7 | using System.Reflection; 8 | 9 | Console.WriteLine("Benchmark results of retrieving the data with JSON still being used"); 10 | var summary = BenchmarkRunner.Run(); 11 | Console.WriteLine(summary.Table.ToString()); 12 | Console.ReadKey(); 13 | 14 | public class LanguageContainerServiceBenchmarks 15 | { 16 | ILanguageContainerService _service; 17 | 18 | public LanguageContainerServiceBenchmarks() 19 | { 20 | var keysProvider = new EmbeddedResourceKeysProvider(Assembly.GetExecutingAssembly()); 21 | _service = new LanguageContainer(CultureInfo.GetCultureInfo("en-US"), keysProvider); 22 | } 23 | 24 | [Benchmark] 25 | public string GetFirstLevelKey() 26 | { 27 | return _service.Keys["FooterMessage"]; 28 | } 29 | 30 | [Benchmark] 31 | public string GetLevelTwoKey() 32 | { 33 | return _service.Keys["HomePage:Login:Title"]; 34 | } 35 | } -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Counter: 9 | Title: مكافحه 10 | ClickMe: انقر فوق Me 11 | FetchData: 12 | Title: جلب البيانات 13 | WeatherForcast: توقعات الطقس 14 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 15 | Loading: تحميل 16 | Date: تاريخ 17 | Temp: Temp 18 | Summary: موجز 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Counter: 9 | Title: Counter 10 | ClickMe: Кликнете върху мен 11 | FetchData: 12 | Title: Извличане на данни 13 | WeatherForcast: Прогноза за времето 14 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 15 | Loading: Зареждане 16 | Date: Дата 17 | Temp: Temp 18 | Summary: Резюме 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Benvingut 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Counter: 9 | Title: Taulell 10 | ClickMe: Feu clic a mi 11 | FetchData: 12 | Title: Obtén dades 13 | WeatherForcast: Previsió 14 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 15 | Loading: Càrrega 16 | Date: Data 17 | Temp: Temp 18 | Summary: Resum 19 | MerryChristmas: Feliz Navidad! -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Counter: 9 | Title: Zähler 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Abrufen von Daten 13 | WeatherForcast: Wettervorhersage 14 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 15 | Loading: Laden 16 | Date: Datum 17 | Temp: Temp 18 | Summary: Zusammenfassung 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Login: Welcome {username} to the system 9 | Hello: Hello {firstname} {lastname} 10 | Counter: 11 | Title: Counter 12 | ClickMe: Click Me 13 | FetchData: 14 | Title: Fetch Data 15 | WeatherForcast: Weather forecast 16 | WeatherTitle: This component demonstrates fetching data from the server 17 | Loading: Loading 18 | Date: Date 19 | Temp: Temp 20 | Summary: Summary 21 | FooterMessage: Thanks for your test 22 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Counter: 9 | Title: Laskuri 10 | ClickMe: Valitse Minä 11 | FetchData: 12 | Title: Hae tiedot 13 | WeatherForcast: Ennuste 14 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 15 | Loading: Lastaus 16 | Date: Päivämäärä 17 | Temp: Temp 18 | Summary: Yhteenveto 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Counter: 9 | Title: Counter 10 | ClickMe: Cliquez sur moi 11 | FetchData: 12 | Title: Rechercher des données 13 | WeatherForcast: Prévisions météo 14 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 15 | Loading: Chargement 16 | Date: Date 17 | Temp: Temp 18 | Summary: Résumé 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Counter: 9 | Title: Contatore 10 | ClickMe: Fare clic su Me 11 | FetchData: 12 | Title: Recupera dati 13 | WeatherForcast: Previsioni meteo 14 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 15 | Loading: Caricamento 16 | Date: Data 17 | Temp: Temp 18 | Summary: Riepilogo 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: ようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Counter: 9 | Title: カウンター 10 | ClickMe: '[私] をクリックします。' 11 | FetchData: 12 | Title: データのフェッチ 13 | WeatherForcast: 天気予報 14 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 15 | Loading: 読み込み 16 | Date: 日付 17 | Temp: 温度 18 | Summary: 概要 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Benchmarks/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: സ്വാഗതം 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Counter: 9 | Title: à ́à μà 10 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 11 | FetchData: 12 | Title: ഡാറ്റ കൊണ്ടുവരിക 13 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 14 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 15 | Loading: ലഭ്യമാക്കുന്നു 16 | Date: തീയതി 17 | Temp: à ́à μà 18 | Summary: സംഗ്രഹം 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Blazor/AKSoftware.Localization.MultiLanguages.Blazor.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | Ahmad Mozaffar 6 | AK Software 7 | AKSoftware.Localization.MultiLanguages is a .NET library that allows .NET developers to build applications that targets multiple languages very easy just with few lines of code, Blazor extensions helps the library to track the status of the components and update them whenever the SetLanguage function being called 8 | https://akmultilanguages.azurewebsites.net 9 | https://github.com/aksoftware98/multilanguages 10 | AKSoftware, Languages, Localization, Globalization, 11 | Add support for Blazor Server and fix its related bugs https://github.com/aksoftware98/multilanguages 12 | AK Software 2024 13 | LICENSE 14 | en-US 15 | true 16 | AkMultiLanguages.png 17 | 6.0.0 18 | 6.0.0.0 19 | true 20 | 6.0.0-alpha 21 | 22 | 23 | 24 | 25 | True 26 | 27 | 28 | 29 | True 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Blazor/AkMultiLanguages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/AKSoftware.Localization.MultiLanguages.Blazor/AkMultiLanguages.png -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Blazor/BlazorExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AKSoftware.Localization.MultiLanguages.Blazor 8 | { 9 | public static class BlazorExtensions 10 | { 11 | 12 | /// 13 | /// Track the state of the component, and it will be updated whenever the SetLanguage function has been called for the client 14 | /// 15 | /// Langauge Container 16 | /// Component to be tracked 17 | public static void InitLocalizedComponent(this ILanguageContainerService language, ComponentBase component) 18 | { 19 | if (component == null) 20 | throw new ArgumentNullException(nameof(component)); 21 | 22 | // Init the extension 23 | var extension = new ComponentExtension() 24 | { 25 | Component = component, 26 | }; 27 | 28 | var action = new Action(async e => 29 | { 30 | // Retrieve the StateHasChanged method and the InvokeAsync of the dispatcher to run the code on the UI thread always 31 | var type = typeof(ComponentBase); 32 | var stateHasChangedMethod = type.GetMethod("StateHasChanged", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 33 | var dispatcherFunction = type.GetMethod("InvokeAsync", 34 | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic, 35 | null, 36 | new Type[] { typeof(Action) }, 37 | null); 38 | // Run the state has changed in the InvokeAsync function 39 | dispatcherFunction.Invoke(extension.Component, new[] { new Action(() => 40 | { 41 | stateHasChangedMethod.Invoke(extension.Component, null); 42 | }) }); 43 | 44 | }); 45 | 46 | extension.Action = action; 47 | 48 | language.AddExtension(extension); 49 | } 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Blazor/ComponentExtension.cs: -------------------------------------------------------------------------------- 1 | using AKSoftware.Localization.MultiLanguages; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace AKSoftware.Localization.MultiLanguages.Blazor 9 | { 10 | public class ComponentExtension : IExtension 11 | { 12 | public object Component { get; set; } 13 | public Action Action { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Blazor/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator.Tests/AKSoftware.Localization.MultiLanguages.SourceGenerator.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | false 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator.Tests/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HelloWorld: Hello World 2 | Hello: Hello 3 | Title: Welcome to my website 4 | Ahhh: Nooo wayy -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator.Tests/en-US.yml: -------------------------------------------------------------------------------- 1 | Test: Hi Brother -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator/AkMultiLanguages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/AKSoftware.Localization.MultiLanguages.SourceGenerator/AkMultiLanguages.png -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator/DependencyInjectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Text; 4 | using System.Threading.Tasks; 5 | 6 | namespace AKSoftware.Localization.MultiLanguages.SourceGenerator 7 | { 8 | 9 | public class DependencyInjectionExtensions 10 | { 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator/GeneratorExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.CodeAnalysis; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace AKSoftware.Localization.MultiLanguages.SourceGenerator 8 | { 9 | internal static class GeneratorExtensions 10 | { 11 | 12 | /// 13 | /// Try find the en-US file content in the referenced project 14 | /// 15 | /// 16 | /// 17 | /// 18 | internal static bool TryGetEnUSFileContent(this GeneratorExecutionContext context, out string fileContent) 19 | { 20 | // Try to fetch the en-US yaml file 21 | var enUSFileContent = context 22 | .AdditionalFiles 23 | .FirstOrDefault(f => f.Path.EndsWith("en-US.yml") || f.Path.EndsWith("en-US.yaml")); 24 | 25 | if (enUSFileContent == null) 26 | { 27 | context.ReportDiagnostic(Diagnostic.Create(new DiagnosticDescriptor("AKSML001", "No en-US file found", "No en-US file found", "Localization", DiagnosticSeverity.Warning, true), Location.None)); 28 | fileContent = null; 29 | return false; 30 | } 31 | 32 | // Read the content of the file 33 | fileContent = enUSFileContent.GetText()?.ToString(); 34 | return true; 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator/KeysAccessorSourceGenerator.cs: -------------------------------------------------------------------------------- 1 | using AKSoftware.Localization.MultiLanguages.CodeGeneration; 2 | using Microsoft.CodeAnalysis; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Text.RegularExpressions; 9 | 10 | namespace AKSoftware.Localization.MultiLanguages.SourceGenerator 11 | { 12 | 13 | /// 14 | /// Source generator to scan the en-US language file and generate an injectable class that can be used to get the keys. 15 | /// The generated class take interpolation into consideration. 16 | /// 17 | [Generator] 18 | public class KeysAccessorSourceGenerator : ISourceGenerator 19 | { 20 | public void Execute(GeneratorExecutionContext context) 21 | { 22 | // Try to fetch the en-US yaml file 23 | if (!context.TryGetEnUSFileContent(out var fileContent)) 24 | return; 25 | 26 | context.AddSource($"LanguageKeysAccessor.g.cs", KeysAccessorGenerator.GenerateKeysAccessorClassesAndInterfaces(fileContent)); 27 | context.AddSource($"DependencyInjectionExtensions.g.cs", KeysAccessorGenerator.GenerateDependencyInjectionExtensionClass()); 28 | 29 | } 30 | 31 | public void Initialize(GeneratorInitializationContext context) 32 | { 33 | // No initialization is needed 34 | } 35 | 36 | 37 | 38 | } 39 | } -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Console Debugger": { 4 | "commandName": "DebugRoslynComponent", 5 | "targetProject": "..\\AKSoftware.Localization.MultiLanguages.SourceGenerator.Debugger\\AKSoftware.Localization.MultiLanguages.SourceGenerator.Debugger.csproj" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator/StaticKeysSourceGenerator.cs: -------------------------------------------------------------------------------- 1 | using AKSoftware.Localization.MultiLanguages.CodeGeneration; 2 | using Microsoft.CodeAnalysis; 3 | using Microsoft.CodeAnalysis.Text; 4 | using System; 5 | using System.Text; 6 | 7 | namespace AKSoftware.Localization.MultiLanguages.SourceGenerator 8 | { 9 | 10 | /// 11 | /// Source generator to generate a static class with a list of constants for each key in the language file 12 | /// 13 | [Generator] 14 | public class StaticKeysSourceGenerator : ISourceGenerator 15 | { 16 | public void Execute(GeneratorExecutionContext context) 17 | { 18 | // Try to fetch the en-US yaml file 19 | if (!context.TryGetEnUSFileContent(out var fileContent)) 20 | return; 21 | 22 | context.AddSource($"LanguageKeys.g.cs", StaticKeysGenerator.GenerateStaticKeyClass(fileContent)); 23 | } 24 | 25 | public void Initialize(GeneratorInitializationContext context) 26 | { 27 | // No initialization is needed 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.SourceGenerator/build/AKSoftware.Localization.MultiLanguages.SourceGenerator.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/AKSoftware.Localization.MultiLanguages.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | 6 | false 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | runtime; build; native; contentfiles; analyzers; buildtransitive 42 | all 43 | 44 | 45 | runtime; build; native; contentfiles; analyzers; buildtransitive 46 | all 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | PreserveNewest 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/CodeGeneratorTests/KeysAccessorGeneratorTests.cs: -------------------------------------------------------------------------------- 1 | using AKSoftware.Localization.MultiLanguages.CodeGeneration; 2 | using Xunit; 3 | 4 | namespace AKSoftware.Localization.MultiLanguages.Tests.CodeGeneratorTests; 5 | 6 | /// 7 | /// TODO Add the assertions to the tests to verify the generated code using the Rosyln syntax tree 8 | /// 9 | public class KeysAccessorGeneratorTests : KeysGeneratorTestBase 10 | { 11 | 12 | [Fact] 13 | public void ValidYaml_Should_GenerateDecoratorInterfaces() 14 | { 15 | var generatedContext = KeysAccessorGenerator.GenerateKeysAccessorClassesAndInterfaces(VALID_FLAT_YAML); 16 | } 17 | 18 | [Fact] 19 | public void FlatYaml_Should_GenerateOneLevelKeysAccessor() 20 | { 21 | var generatedContext = KeysAccessorGenerator.GenerateKeysAccessorClassesAndInterfaces(VALID_FLAT_YAML); 22 | 23 | } 24 | 25 | [Fact] 26 | public void NestedYaml_Should_GenerateNestedKeysAccessor() 27 | { 28 | var generatedContext = KeysAccessorGenerator.GenerateKeysAccessorClassesAndInterfaces(VALID_NESTED_YAML); 29 | 30 | } 31 | 32 | [Fact] 33 | public void YamlWithoutInterpolation_Should_GenerateKeysAsReadOnlyProperties() 34 | { 35 | var generatedContext = KeysAccessorGenerator.GenerateKeysAccessorClassesAndInterfaces(VALID_FLAT_YAML); 36 | 37 | } 38 | 39 | [Fact] 40 | public void YamlWithInterpolation_Should_GenerateKeysAsMethodsWithParameters() 41 | { 42 | var generatedContext = KeysAccessorGenerator.GenerateKeysAccessorClassesAndInterfaces(VALID_INTERPOLATED_YAML); 43 | 44 | } 45 | 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/CodeGeneratorTests/KeysGeneratorTestBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AKSoftware.Localization.MultiLanguages.Tests.CodeGeneratorTests; 8 | 9 | public class KeysGeneratorTestBase 10 | { 11 | 12 | protected const string VALID_FLAT_YAML = """ 13 | HelloWorld: Hello World 14 | Title: Title 15 | Home: Home 16 | About: About us 17 | """; 18 | 19 | protected const string VALID_NESTED_YAML = """ 20 | Contact: Contact us 21 | Home: 22 | Title: Home Title 23 | Subtitle: Home Subtitle 24 | About: 25 | Title: About Title 26 | Subtitle: About Subtitle 27 | """; 28 | 29 | protected const string VALID_INTERPOLATED_YAML = """ 30 | Contact: Email us via {email} and call us on {phone} 31 | """; 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/CodeGeneratorTests/StaticKeysGeneratorTests.cs: -------------------------------------------------------------------------------- 1 | using AKSoftware.Localization.MultiLanguages.CodeGeneration; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Xunit; 8 | 9 | namespace AKSoftware.Localization.MultiLanguages.Tests.CodeGeneratorTests; 10 | 11 | public class StaticKeysGeneratorTests : KeysGeneratorTestBase 12 | { 13 | 14 | [Fact] 15 | public void ValidYaml_Should_GenerateStaticKeysClass() 16 | { 17 | var generatedContext = StaticKeysGenerator.GenerateStaticKeyClass(VALID_FLAT_YAML); 18 | } 19 | 20 | [Fact] 21 | public void ValidNestedYaml_Should_GenerateStaticKeysClass() 22 | { 23 | var generatedContext = StaticKeysGenerator.GenerateStaticKeyClass(VALID_NESTED_YAML); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/MyEnum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace AKSoftware.Localization.MultiLanguages.Tests 5 | { 6 | public enum MyEnum 7 | { 8 | [Description("HomePage:Title")] 9 | HomePageTitle, 10 | MerryChristmas 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Counter: 9 | Title: مكافحه 10 | ClickMe: انقر فوق Me 11 | FetchData: 12 | Title: جلب البيانات 13 | WeatherForcast: توقعات الطقس 14 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 15 | Loading: تحميل 16 | Date: تاريخ 17 | Temp: Temp 18 | Summary: موجز 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Counter: 9 | Title: Counter 10 | ClickMe: Кликнете върху мен 11 | FetchData: 12 | Title: Извличане на данни 13 | WeatherForcast: Прогноза за времето 14 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 15 | Loading: Зареждане 16 | Date: Дата 17 | Temp: Temp 18 | Summary: Резюме 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Benvingut 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Counter: 9 | Title: Taulell 10 | ClickMe: Feu clic a mi 11 | FetchData: 12 | Title: Obtén dades 13 | WeatherForcast: Previsió 14 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 15 | Loading: Càrrega 16 | Date: Data 17 | Temp: Temp 18 | Summary: Resum 19 | MerryChristmas: Feliz Navidad! 20 | Contacts: 21 | Address: 22 | Title: Adreça 23 | Street: Carrer 24 | City: Ciutat 25 | Country: País -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Counter: 9 | Title: Zähler 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Abrufen von Daten 13 | WeatherForcast: Wettervorhersage 14 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 15 | Loading: Laden 16 | Date: Datum 17 | Temp: Temp 18 | Summary: Zusammenfassung 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Login: Welcome {username} to the system 9 | Hello: Hello {firstname} {lastname} 10 | Counter: 11 | Title: Counter 12 | ClickMe: Click Me 13 | FetchData: 14 | Title: Fetch Data 15 | WeatherForcast: Weather forecast 16 | WeatherTitle: This component demonstrates fetching data from the server 17 | Loading: Loading 18 | Date: Date 19 | Temp: Temp 20 | Summary: Summary 21 | 22 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Counter: 9 | Title: Laskuri 10 | ClickMe: Valitse Minä 11 | FetchData: 12 | Title: Hae tiedot 13 | WeatherForcast: Ennuste 14 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 15 | Loading: Lastaus 16 | Date: Päivämäärä 17 | Temp: Temp 18 | Summary: Yhteenveto 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Counter: 9 | Title: Counter 10 | ClickMe: Cliquez sur moi 11 | FetchData: 12 | Title: Rechercher des données 13 | WeatherForcast: Prévisions météo 14 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 15 | Loading: Chargement 16 | Date: Date 17 | Temp: Temp 18 | Summary: Résumé 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Counter: 9 | Title: Contatore 10 | ClickMe: Fare clic su Me 11 | FetchData: 12 | Title: Recupera dati 13 | WeatherForcast: Previsioni meteo 14 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 15 | Loading: Caricamento 16 | Date: Data 17 | Temp: Temp 18 | Summary: Riepilogo 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: ようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Counter: 9 | Title: カウンター 10 | ClickMe: '[私] をクリックします。' 11 | FetchData: 12 | Title: データのフェッチ 13 | WeatherForcast: 天気予報 14 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 15 | Loading: 読み込み 16 | Date: 日付 17 | Temp: 温度 18 | Summary: 概要 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: സ്വാഗതം 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Counter: 9 | Title: à ́à μà 10 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 11 | FetchData: 12 | Title: ഡാറ്റ കൊണ്ടുവരിക 13 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 14 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 15 | Loading: ലഭ്യമാക്കുന്നു 16 | Date: തീയതി 17 | Temp: à ́à μà 18 | Summary: സംഗ്രഹം 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/TestClasses/Customer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AKSoftware.Localization.MultiLanguages.Tests.TestClasses 4 | { 5 | public class Customer 6 | { 7 | [Required] 8 | public string Name { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/TestHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace AKSoftware.Localization.MultiLanguages.Tests 9 | { 10 | public static class TestHelper 11 | { 12 | public static string GetSolutionPath() 13 | { 14 | string currentPath = AppDomain.CurrentDomain.BaseDirectory; 15 | int count = 0; 16 | const int maxDepth = 1000; 17 | 18 | while (count < maxDepth) 19 | { 20 | string[] files = Directory.GetFiles(currentPath, "*.sln"); 21 | 22 | if (files.Any()) 23 | { 24 | return currentPath; 25 | } 26 | 27 | string? parentPath = Path.GetDirectoryName(currentPath); 28 | 29 | //We are at the root we did not find anything 30 | if (parentPath == null || parentPath == currentPath) 31 | throw new DirectoryNotFoundException("Could not find solution path for " + AppDomain.CurrentDomain.BaseDirectory); 32 | 33 | currentPath = parentPath; 34 | count++; 35 | } 36 | 37 | throw new DirectoryNotFoundException("Reached Max Depth. Could not find solution path for " + AppDomain.CurrentDomain.BaseDirectory); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.Tests/ValidationLocalizationTests.cs: -------------------------------------------------------------------------------- 1 | using AKSoftware.Localization.MultiLanguages.Providers; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using Microsoft.AspNetCore.Components.Forms; 10 | using Xunit; 11 | using Xunit.Abstractions; 12 | 13 | namespace AKSoftware.Localization.MultiLanguages.Tests 14 | { 15 | public class ValidationLocalizationTests 16 | { 17 | private readonly ITestOutputHelper _output; 18 | 19 | public ValidationLocalizationTests(ITestOutputHelper output) 20 | { 21 | _output = output; 22 | } 23 | 24 | [Fact] 25 | public void ValidateModelTest() 26 | { 27 | //Arrange 28 | var customer = new TestClasses.Customer(); 29 | var keysProvider = new EmbeddedResourceKeysProvider(Assembly.GetExecutingAssembly()); 30 | ILanguageContainerService language = new LanguageContainer(CultureInfo.GetCultureInfo("en-US"), keysProvider); 31 | EditContext editContext = new EditContext(customer); 32 | var validationMessageStore = new ValidationMessageStore(editContext); 33 | 34 | //Act 35 | ValidationLocalization.ValidateModel(customer, validationMessageStore, language); 36 | 37 | //Assert 38 | List messages = validationMessageStore[editContext.Field("Name")].ToList(); 39 | Assert.NotEmpty(messages); 40 | Assert.Equal("Name is required", messages[0]); 41 | 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/AKSoftware.Localization.MultiLanguages.UWP.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AKSoftware.Localization.MultiLangauges.UWP 5 | 1.1.0 6 | AKSoftware.Localization.MultiLangauges.UWP 7 | Michael Gerfen 8 | true 9 | MIT 10 | https://licenses.nuget.org/MIT 11 | images\AkMultiLanguages.png 12 | https://github.com/aksoftware98/multilanguages 13 | AKSoftware.Localization.MultiLanguages is a .NET library that allows .NET developers to build applications that targets multiple languages very easy just with few lines of code 14 | Adding XAML extension to access the language keywords 15 | 2021 16 | UWP Localization MultiLanguages dotnetcore dotnet Windows10 WinUI Globalization AKSoftware 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/AkMultiLanguages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/AKSoftware.Localization.MultiLanguages.UWP/AkMultiLanguages.png -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/Behaviors/MultiBindingItem.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml; 2 | 3 | namespace AKSoftware.Localization.MultiLanguages.UWP.Behaviors 4 | { 5 | public class MultiBindingItem : DependencyObject 6 | { 7 | /// 8 | /// Gets or sets the binding value. 9 | /// 10 | /// The binding value. 11 | public object Value 12 | { 13 | get => GetValue(ValueProperty); 14 | set => SetValue(ValueProperty, value); 15 | } 16 | 17 | /// 18 | /// Identifier for the dependency property. 19 | /// 20 | public static readonly DependencyProperty ValueProperty = 21 | DependencyProperty.Register(nameof(Value), typeof(object), typeof(MultiBindingItem), new PropertyMetadata(null, OnValueChanged)); 22 | 23 | private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 24 | { 25 | var multiBindingItem = (MultiBindingItem)d; 26 | 27 | multiBindingItem.Update(); 28 | } 29 | 30 | internal MultiBindingItemCollection Parent { get; set; } 31 | 32 | private void Update() 33 | { 34 | var parent = Parent; 35 | 36 | if (parent != null) 37 | { 38 | parent.Update(); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/Converters/LocalizationConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using Windows.UI.Xaml; 6 | using Microsoft.Extensions.DependencyInjection; 7 | 8 | namespace AKSoftware.Localization.MultiLanguages.UWP.Converters 9 | { 10 | public class LocalizationConverter : MultiValueConverterBase 11 | { 12 | public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 13 | { 14 | if (values.Any(item => item == null)) 15 | { 16 | return null; 17 | } 18 | 19 | var localization = (Application.Current as IServiceProviderHost).ServiceProvider.GetService(); 20 | 21 | if (localization == null) 22 | { 23 | return null; 24 | } 25 | 26 | var key = (string)values[0]; 27 | 28 | var keyValues = new Dictionary(); 29 | if (values.Length > 1) 30 | { 31 | foreach (var o in values.Skip(1)) 32 | { 33 | var val = (string) o; 34 | var parts = val.Split(":"); 35 | if (parts.Length == 2) 36 | { 37 | keyValues[parts[0]] = parts[1]; 38 | } 39 | } 40 | } 41 | 42 | return localization[key, keyValues]; 43 | } 44 | 45 | public override object[] ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 46 | { 47 | throw new NotImplementedException(); 48 | } 49 | 50 | public object Convert(object value, Type targetType, object parameter, string language) 51 | { 52 | var localization = (Application.Current as IServiceProviderHost).ServiceProvider.GetService(); 53 | var key = (value as string); 54 | return localization[key]; 55 | } 56 | 57 | public object ConvertBack(object value, Type targetType, object parameter, string language) 58 | { 59 | throw new NotImplementedException(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/Extensions/LanguageServiceExtension.cs: -------------------------------------------------------------------------------- 1 | namespace AKSoftware.Localization.MultiLanguages.UWP.Extensions 2 | { 3 | public static class LanguageServiceExtension 4 | { 5 | public static string GetValue(ILanguageContainerService localization, string key) 6 | { 7 | return localization[key]; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/Extensions/LocalizeStringExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Windows.UI.Xaml.Markup; 3 | 4 | namespace AKSoftware.Localization.MultiLanguages.UWP.Extensions 5 | { 6 | [MarkupExtensionReturnType(ReturnType = typeof(string))] 7 | public class LocalizeStringExtension : MarkupExtension 8 | { 9 | public string Key { get; set; } 10 | 11 | public bool Capitalize { get; set; } 12 | 13 | protected override object ProvideValue() 14 | { 15 | var language = ((IServiceProviderHost)Windows.UI.Xaml.Application.Current).ServiceProvider.GetService(); 16 | var value = language?[Key]; 17 | 18 | return Capitalize ? value?.ToUpperInvariant() : value; 19 | 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/IServiceProviderHost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AKSoftware.Localization.MultiLanguages.UWP 4 | { 5 | public interface IServiceProviderHost 6 | { 7 | // marker interface 8 | IServiceProvider ServiceProvider { get; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/LocalizationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AKSoftware.Localization.MultiLanguages.UWP 8 | { 9 | public static class LocalizationService 10 | { 11 | 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/Properties/AKSoftware.Localization.MultiLanguages.UWP.rd.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AKSoftware.Localization.MultiLanguages.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AKSoftware.Localization.MultiLanguages.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/AKSoftware.Localization.MultiLanguages.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | AK Software 6 | Ahmad Mozaffar 7 | AKSoftware.Localization.MultiLanguages is a .NET library that allows .NET developers to build applications that targets multiple languages very easy just with few lines of code 8 | AK Software 2023 9 | AKSoftware, Languages, Localization, Globalization, 10 | Add capability to list languages dynamically, list and enumerate all keys, genreate static keys class and full keys accessor classes, in addition to bug fixes and improvements 11 | en-US 12 | true 13 | LICENSE 14 | https://akmultilanguages.azurewebsites.net 15 | https://github.com/aksoftware98/multilanguages 16 | AkMultiLanguages.png 17 | 6.0.0 18 | 6.0.0 19 | true 20 | 6.0.0-alpha 21 | README.md 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | True 35 | 36 | 37 | 38 | True 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | ..\..\..\..\..\Desktop\YamlDotNet.dll 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/AkMultiLanguages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/AKSoftware.Localization.MultiLanguages/AkMultiLanguages.png -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/CodeGeneration/CodeGenerationExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace AKSoftware.Localization.MultiLanguages.CodeGeneration 6 | { 7 | internal static class CodeGenerationExtensions 8 | { 9 | 10 | /// 11 | /// Append the generated by a tool comment to the string builder 12 | /// 13 | /// 14 | internal static void AppendGeneratedByToolComment(this StringBuilder stringBuilder) 15 | { 16 | stringBuilder.AppendLine(GetGeneratedByToolComment()); 17 | } 18 | 19 | internal static string GetGeneratedByToolComment() 20 | { 21 | return @"//------------------------------------------------------------------------------ 22 | // 23 | // This code was generated by a AKSoftware.Localization.MultiLanguages. 24 | // 25 | // Changes to this file may cause incorrect behavior and will be lost if 26 | // the code is regenerated. 27 | // 28 | // For more information see: https://github.com/aksoftware98/multilanguages 29 | // 30 | //------------------------------------------------------------------------------"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/CodeGeneration/IGenerateKeysService.cs: -------------------------------------------------------------------------------- 1 | namespace AKSoftware.Localization.MultiLanguages.CodeGeneration 2 | { 3 | public interface IGenerateKeysService 4 | { 5 | void CreateStaticConstantsKeysFile(string namespaceName, string className, string filePath); 6 | void CreateEnumKeysFile(string namespaceName, string enumName, string filePath); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/CodeGeneration/StaticKeysGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace AKSoftware.Localization.MultiLanguages.CodeGeneration 6 | { 7 | /// 8 | /// Provides the tool to generate a class that contains all the keys as static constants. Nested keys will be subclasses of the main class. 9 | /// 10 | public class StaticKeysGenerator 11 | { 12 | 13 | /// 14 | /// Generate a class that contains all the keys as static constants. Nested keys will be subclasses of the main class. 15 | /// 16 | /// 17 | /// 18 | public static string GenerateStaticKeyClass(string enUSFileContent) 19 | { 20 | var keyValues = new YamlDotNet.Serialization.Deserializer().Deserialize>(enUSFileContent); 21 | 22 | var sourceCode = $@" 23 | using System; 24 | using AKSoftware.Localization.MultiLanguages; 25 | 26 | namespace AKSoftware.Localization.MultiLanguages 27 | {{ 28 | {BuildClass(keyValues, "LanguageKeys", string.Empty)} 29 | }}"; 30 | return sourceCode; 31 | } 32 | 33 | 34 | private static string BuildClass(Dictionary keyValues, string className, string prefix) 35 | { 36 | var stringBuilder = new StringBuilder(); 37 | prefix = string.IsNullOrWhiteSpace(prefix) ? string.Empty : prefix + ":"; 38 | stringBuilder.AppendLine($"\tpublic static class {className}"); 39 | stringBuilder.AppendLine("\t{"); 40 | foreach (var key in keyValues) 41 | { 42 | 43 | if (key.Value is Dictionary nestedKeyValues) 44 | { 45 | stringBuilder.AppendLine(BuildClass(nestedKeyValues, key.Key.ToString(), $"{prefix}{key.Key}")); 46 | } 47 | else 48 | { 49 | stringBuilder.AppendLine($"\t\tpublic const string {key.Key} = \"{prefix}{key.Key}\";"); 50 | } 51 | 52 | } 53 | stringBuilder.AppendLine("\t}"); 54 | 55 | return stringBuilder.ToString(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/IExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace AKSoftware.Localization.MultiLanguages 6 | { 7 | public interface IExtension 8 | { 9 | 10 | object Component { get; set; } 11 | 12 | Action Action { get; set; } 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/LanguageContainerInAssembly.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Globalization; 3 | using AKSoftware.Localization.MultiLanguages.Providers; 4 | 5 | namespace AKSoftware.Localization.MultiLanguages 6 | { 7 | //NB: For backwards compatibility 8 | public class LanguageContainerInAssembly : LanguageContainer 9 | { 10 | public LanguageContainerInAssembly(CultureInfo culture, IKeysProvider keyProvider) : base(culture, keyProvider) 11 | { 12 | } 13 | 14 | public LanguageContainerInAssembly(IKeysProvider keysProvider) : base(keysProvider) 15 | { 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/LanguageContainerOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Reflection; 3 | 4 | namespace AKSoftware.Localization.MultiLanguages 5 | { 6 | public class LanguageContainerOptions 7 | { 8 | 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/LocalizationFolderType.cs: -------------------------------------------------------------------------------- 1 | namespace AKSoftware.Localization.MultiLanguages 2 | { 3 | public enum LocalizationFolderType 4 | { 5 | LocalFolder = 0, 6 | InstallationFolder = 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/ParseParms.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace AKSoftware.Localization.MultiLanguages 4 | { 5 | public class ParseParms 6 | { 7 | public List Prefixes { get; set; } = new List() { "Dynamic"}; 8 | public List SourceDirectories { get; set; } = new List(); 9 | public List WildcardPatterns { get; set; } = new List(); 10 | public List ExcludeDirectories { get; set; } = new List(); 11 | public List ExcludeFiles { get; set; } = new List(); 12 | public string ResourceFilePath { get; set; } 13 | public string KeyReference { get; set; } = "Language"; 14 | public string InjectLanguageContainerCode { get; set; } = @"[Inject] private ILanguageContainerService Language { get; set; }"; 15 | public string InitLanguageContainerCode { get; set; } = @"Language.InitLocalizedComponent(this);"; 16 | public bool RemoveLocalizedKeys { get; set; } = false; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/ParseResult.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace AKSoftware.Localization.MultiLanguages 4 | { 5 | public class ParseResult 6 | { 7 | public Regex MatchingExpression { get; set; } 8 | public string FilePath { get; set; } = string.Empty; 9 | public string LocalizableString { get; set; } = string.Empty; 10 | public string MatchValue { get; set; } = string.Empty; 11 | public string Key { get; set; } = string.Empty; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/Providers/BaseKeysProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Globalization; 3 | using System.Text.RegularExpressions; 4 | 5 | namespace AKSoftware.Localization.MultiLanguages.Providers 6 | { 7 | public abstract class BaseKeysProvider : IKeysProvider 8 | { 9 | /// 10 | /// Three groups: en.yml, en-US.yml, az-Latn-AZ.yml 11 | /// https://www.csharp-examples.net/culture-names/ 12 | /// 13 | protected Regex YamlFilePattern = 14 | new Regex( 15 | @"^([A-Za-z]{2}\-[A-Za-z]+\-[A-Za-z]{2}\.ya?ml)|([A-Za-z]{2}\-[A-Za-z]{2}\.ya?ml)|([A-Za-z]{2}\.ya?ml)$", 16 | RegexOptions.Compiled); 17 | 18 | /// 19 | /// Retrieve an instance of from a object 20 | /// 21 | /// 22 | /// 23 | public abstract Keys GetKeys(CultureInfo cultureInfo); 24 | 25 | /// 26 | /// Retrieves an instance of from the name of the culture, the name of the culture should be in the format of "en-US" 27 | /// 28 | /// 29 | /// 30 | public abstract Keys GetKeys(string cultureName); 31 | 32 | /// 33 | /// Get a list of the registered languages 34 | /// 35 | public abstract IEnumerable RegisteredLanguages { get; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/AKSoftware.Localization.MultiLanguages/Providers/IKeysProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Globalization; 3 | 4 | namespace AKSoftware.Localization.MultiLanguages.Providers 5 | { 6 | /// 7 | /// Keys provider interface, it wraps the functionality of the get the keys, 8 | /// 9 | public interface IKeysProvider 10 | { 11 | /// 12 | /// Retrieve an instance of from a object 13 | /// 14 | /// 15 | /// 16 | Keys GetKeys(CultureInfo cultureInfo); 17 | 18 | /// 19 | /// Retrieves an instance of from the name of the culture, the name of the culture should be in the format of "en-US" 20 | /// 21 | /// 22 | /// 23 | Keys GetKeys(string cultureName); 24 | 25 | /// 26 | /// Get a list of the registered languages 27 | /// 28 | IEnumerable RegisteredLanguages { get; } 29 | } 30 | } -------------------------------------------------------------------------------- /src/BlazorAKLocalization/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/BlazorAKLocalization.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @inject ILanguageContainerService languageContainer 3 | 4 |

@languageContainer.Keys["Counter:Title"]

5 | 6 |

@languageContainer.Keys["Counter:Title"]: @currentCount

7 | 8 | 9 | 10 | @code { 11 | private int currentCount = 0; 12 | 13 | private void IncrementCount() 14 | { 15 | currentCount++; 16 | } 17 | 18 | 19 | protected override void OnInitialized() 20 | { 21 | languageContainer.InitLocalizedComponent(this); 22 | base.OnInitialized(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @inject HttpClient Http 3 | @inject ILanguageContainerService languageContainer 4 | 5 |

@languageContainer.Keys["FetchData:WeatherForcast"]

6 | 7 |

@languageContainer.Keys["FetchData:WeatherTitle"]

8 | 9 | @if (forecasts == null) 10 | { 11 |

@languageContainer.Keys["FetchData:Loading"]...

12 | } 13 | else 14 | { 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var forecast in forecasts) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 |
@languageContainer.Keys["FetchData:Date"]@languageContainer.Keys["FetchData:Temp"]. (C)@languageContainer.Keys["FetchData:Temp"]. (F)@languageContainer.Keys["FetchData:Summary"]
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
36 | } 37 | 38 | @code { 39 | private WeatherForecast[] forecasts; 40 | 41 | protected override async Task OnInitializedAsync() 42 | { 43 | languageContainer.InitLocalizedComponent(this); 44 | forecasts = await Http.GetFromJsonAsync("sample-data/weather.json"); 45 | } 46 | 47 | public class WeatherForecast 48 | { 49 | public DateTime Date { get; set; } 50 | 51 | public int TemperatureC { get; set; } 52 | 53 | public string Summary { get; set; } 54 | 55 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using Blazored.LocalStorage 3 | 4 | @inject ILanguageContainerService languageContainer 5 | @inject ILocalStorageService storage 6 | 7 |

@languageContainer.Keys["HomePage:HelloWorld"]

8 | 9 | @languageContainer.Keys["HomePage:Welcome", new 10 | { 11 | username = "aksoftware98" 12 | }] 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | @code 31 | { 32 | async void SetLanguage(string language) 33 | { 34 | languageContainer.SetLanguage(System.Globalization.CultureInfo.GetCultureInfo(language)); 35 | // Store the langauge 36 | await storage.SetItemAsync("language-code", language); 37 | } 38 | 39 | protected override void OnInitialized() 40 | { 41 | languageContainer.InitLocalizedComponent(this); 42 | base.OnInitialized(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Net.Http; 8 | using System.Reflection; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using AKSoftware.Localization.MultiLanguages; 12 | using Blazored.LocalStorage; 13 | using AKSoftware.Localization.MultiLanguages.Providers; 14 | 15 | namespace BlazorAKLocalization 16 | { 17 | public class Program 18 | { 19 | public static async Task Main(string[] args) 20 | { 21 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 22 | builder.RootComponents.Add("#app"); 23 | 24 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 25 | 26 | // Load the language container with files from the Resources Folder 27 | //builder.Services.AddLanguageContainer(Assembly.GetExecutingAssembly()); 28 | builder.Services.AddLanguageContainer(Assembly.GetExecutingAssembly(), "Resources"); 29 | 30 | builder.Services.AddBlazoredLocalStorage(); 31 | // Load the language Container with the files from a custom folder 32 | //builder.Services.AddLanguageContainer(Assembly.GetExecutingAssembly(), folderName: "TestFolder"); 33 | 34 | builder.Services.AddScoped(); 35 | 36 | 37 | await builder.Build().RunAsync(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:62444", 7 | "sslPort": 44307 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "BlazorAKLocalization": { 20 | "commandName": "Project", 21 | "dotnetRunMessages": "true", 22 | "launchBrowser": true, 23 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا {username} في التجربة 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Counter: 9 | Title: مكافحه 10 | ClickMe: انقر فوق Me 11 | FetchData: 12 | Title: جلب البيانات 13 | WeatherForcast: توقعات الطقس 14 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 15 | Loading: تحميل 16 | Date: تاريخ 17 | Temp: Temp 18 | Summary: موجز 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли {username} на теста 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Counter: 9 | Title: Counter 10 | ClickMe: Кликнете върху мен 11 | FetchData: 12 | Title: Извличане на данни 13 | WeatherForcast: Прогноза за времето 14 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 15 | Loading: Зареждане 16 | Date: Дата 17 | Temp: Temp 18 | Summary: Резюме 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Bienvenida {username} a la prueba 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Counter: 9 | Title: Taulell 10 | ClickMe: Feu clic a mi 11 | FetchData: 12 | Title: Obtén dades 13 | WeatherForcast: Previsió 14 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 15 | Loading: Càrrega 16 | Date: Data 17 | Temp: Temp 18 | Summary: Resum 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen {username} zum Test 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Counter: 9 | Title: Zähler 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Abrufen von Daten 13 | WeatherForcast: Wettervorhersage 14 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 15 | Loading: Laden 16 | Date: Datum 17 | Temp: Temp 18 | Summary: Zusammenfassung 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome {username} to the test 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Counter: 9 | Title: Counter 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Fetch Data 13 | WeatherForcast: Weather forecast 14 | WeatherTitle: This component demonstrates fetching data from the server 15 | Loading: Loading 16 | Date: Date 17 | Temp: Temp 18 | Summary: Summary 19 | 20 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa {username} testiin 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Counter: 9 | Title: Laskuri 10 | ClickMe: Valitse Minä 11 | FetchData: 12 | Title: Hae tiedot 13 | WeatherForcast: Ennuste 14 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 15 | Loading: Lastaus 16 | Date: Päivämäärä 17 | Temp: Temp 18 | Summary: Yhteenveto 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue {username} au test 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Counter: 9 | Title: Counter 10 | ClickMe: Cliquez sur moi 11 | FetchData: 12 | Title: Rechercher des données 13 | WeatherForcast: Prévisions météo 14 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 15 | Loading: Chargement 16 | Date: Date 17 | Temp: Temp 18 | Summary: Résumé 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto {username} per il test 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Counter: 9 | Title: Contatore 10 | ClickMe: Fare clic su Me 11 | FetchData: 12 | Title: Recupera dati 13 | WeatherForcast: Previsioni meteo 14 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 15 | Loading: Caricamento 16 | Date: Data 17 | Temp: Temp 18 | Summary: Riepilogo 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: テストする{username}へようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Counter: 9 | Title: カウンター 10 | ClickMe: '[私] をクリックします。' 11 | FetchData: 12 | Title: データのフェッチ 13 | WeatherForcast: 天気予報 14 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 15 | Loading: 読み込み 16 | Date: 日付 17 | Temp: 温度 18 | Summary: 概要 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: परीक्षण करने के लिए आपका स्वागत है {username} 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Counter: 9 | Title: à ́à μà 10 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 11 | FetchData: 12 | Title: ഡാറ്റ കൊണ്ടുവരിക 13 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 14 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 15 | Loading: ലഭ്യമാക്കുന്നു 16 | Date: തീയതി 17 | Temp: à ́à μà 18 | Summary: സംഗ്രഹം 19 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @using Blazored.LocalStorage 3 | @inject ILocalStorageService storage 4 | @inject ILanguageContainerService language 5 | 6 |
7 | 10 | 11 |
12 |
13 | About 14 |
15 | 16 |
17 | @Body 18 |
19 |
20 |
21 | 22 | @code 23 | { 24 | 25 | 26 | protected async override Task OnInitializedAsync() 27 | { 28 | string languageCode = "en-US"; 29 | if (await storage.ContainKeyAsync("language-code")) 30 | languageCode = await storage.GetItemAsStringAsync("language-code"); 31 | 32 | language.SetLanguage(System.Globalization.CultureInfo.GetCultureInfo(languageCode)); 33 | } 34 | 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | .main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth) { 36 | display: none; 37 | } 38 | 39 | .top-row.auth { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a, .top-row .btn-link { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .main > div { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | @inject ILanguageContainerService languageContainer 2 | 3 | 9 | 10 |
11 | 28 |
29 | 30 | @code { 31 | private bool collapseNavMenu = true; 32 | 33 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 34 | 35 | private void ToggleNavMenu() 36 | { 37 | collapseNavMenu = !collapseNavMenu; 38 | } 39 | 40 | protected override void OnInitialized() 41 | { 42 | languageContainer.InitLocalizedComponent(this); 43 | base.OnInitialized(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | @inject ILanguageContainerService languageContainer 2 | 3 | 13 | 14 | @code { 15 | // Demonstrates how a parent component can supply parameters 16 | [Parameter] 17 | public string Title { get; set; } 18 | 19 | protected override void OnInitialized() 20 | { 21 | languageContainer.InitLocalizedComponent(this); 22 | base.OnInitialized(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using BlazorAKLocalization 10 | @using BlazorAKLocalization.Shared 11 | @using AKSoftware.Localization.MultiLanguages 12 | @using AKSoftware.Localization.MultiLanguages.Blazor 13 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | .content { 18 | padding-top: 1.1rem; 19 | } 20 | 21 | .valid.modified:not([type=checkbox]) { 22 | outline: 1px solid #26b050; 23 | } 24 | 25 | .invalid { 26 | outline: 1px solid red; 27 | } 28 | 29 | .validation-message { 30 | color: red; 31 | } 32 | 33 | #blazor-error-ui { 34 | background: lightyellow; 35 | bottom: 0; 36 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 37 | display: none; 38 | left: 0; 39 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 40 | position: fixed; 41 | width: 100%; 42 | z-index: 1000; 43 | } 44 | 45 | #blazor-error-ui .dismiss { 46 | cursor: pointer; 47 | position: absolute; 48 | right: 0.75rem; 49 | top: 0.5rem; 50 | } 51 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorAKLocalization/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorAKLocalization/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | BlazorAKLocalization 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Loading...
16 | 17 |
18 | An unhandled error has occurred. 19 | Reload 20 | 🗙 21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/BlazorAKLocalization/wwwroot/sample-data/weather.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2018-05-06", 4 | "temperatureC": 1, 5 | "summary": "Freezing" 6 | }, 7 | { 8 | "date": "2018-05-07", 9 | "temperatureC": 14, 10 | "summary": "Bracing" 11 | }, 12 | { 13 | "date": "2018-05-08", 14 | "temperatureC": -13, 15 | "summary": "Freezing" 16 | }, 17 | { 18 | "date": "2018-05-09", 19 | "temperatureC": -16, 20 | "summary": "Balmy" 21 | }, 22 | { 23 | "date": "2018-05-10", 24 | "temperatureC": -2, 25 | "summary": "Chilly" 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/BlazorServerLocalizationSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | PreserveNewest 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorServerLocalizationSample.Data 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorServerLocalizationSample.Data 2 | { 3 | public class WeatherForecastService 4 | { 5 | private static readonly string[] Summaries = new[] 6 | { 7 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 8 | }; 9 | 10 | public Task GetForecastAsync(DateTime startDate) 11 | { 12 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 13 | { 14 | Date = startDate.AddDays(index), 15 | TemperatureC = Random.Shared.Next(-20, 55), 16 | Summary = Summaries[Random.Shared.Next(Summaries.Length)] 17 | }).ToArray()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @inject ILanguageContainerService Language 3 | @Language.Keys["Counter:Title"] 4 | 5 |

@Language.Keys["Counter:Title"]

6 | 7 |

@Language.Keys["Counter:Title"]: @currentCount

8 | 9 | 10 | 11 | 12 | @code { 13 | private int currentCount = 0; 14 | 15 | private void IncrementCount() 16 | { 17 | currentCount++; 18 | } 19 | 20 | protected override void OnInitialized() 21 | { 22 | Language.InitLocalizedComponent(this); 23 | base.OnInitialized(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model BlazorServerLocalizationSample.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace BlazorServerLocalizationSample.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | private readonly ILogger _logger; 16 | 17 | public ErrorModel(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @inject ILanguageContainerService Language 3 | @Language.Keys["FetchData:WeatherTitle"] 4 | 5 | @using BlazorServerLocalizationSample.Data 6 | @inject WeatherForecastService ForecastService 7 | 8 |

@Language.Keys["FetchData:WeatherForcast"]

9 | 10 |

@Language.Keys["FetchData:WeatherTitle"]

11 | 12 | @if (forecasts == null) 13 | { 14 |

@Language.Keys["FetchData:Loading"]...

15 | } 16 | else 17 | { 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @foreach (var forecast in forecasts) 29 | { 30 | 31 | 32 | 33 | 34 | 35 | 36 | } 37 | 38 |
@Language.Keys["FetchData:Date"]@Language.Keys["FetchData:Temp"]. (C)@Language.Keys["FetchData:Temp"]. (F)@Language.Keys["FetchData:Summary"]
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
39 | } 40 | 41 | @code { 42 | private WeatherForecast[]? forecasts; 43 | 44 | protected override async Task OnInitializedAsync() 45 | { 46 | Language.InitLocalizedComponent(this); 47 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @inject ILanguageContainerService Language 3 | 4 | @Language["HomePage:Title"] 5 | 6 |

@Language["HomePage:HelloWorld"]

7 | 8 | @Language["HomePage:Welcome", new { username = "John Doe" }] 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | @code 27 | { 28 | private async void SetLanguage(string language) 29 | { 30 | await InvokeAsync(() => 31 | { 32 | Language.SetLanguage(System.Globalization.CultureInfo.GetCultureInfo(language)); 33 | }); 34 | 35 | } 36 | 37 | protected override void OnInitialized() 38 | { 39 | Language.InitLocalizedComponent(this); 40 | 41 | base.OnInitialized(); 42 | } 43 | } -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorServerLocalizationSample.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = "_Layout"; 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Pages/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @namespace BlazorServerLocalizationSample.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | @RenderBody() 18 | 19 |
20 | 21 | An error has occurred. This application may no longer respond until reloaded. 22 | 23 | 24 | An unhandled exception has occurred. See browser dev tools for details. 25 | 26 | Reload 27 | 🗙 28 |
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorServerLocalizationSample.Data; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.AspNetCore.Components.Web; 4 | using AKSoftware.Localization.MultiLanguages; 5 | using System.Reflection; 6 | using AKSoftware.Localization.MultiLanguages.Providers; 7 | using System.Globalization; 8 | 9 | var builder = WebApplication.CreateBuilder(args); 10 | 11 | // Add services to the container. 12 | builder.Services.AddRazorPages(); 13 | builder.Services.AddServerSideBlazor(); 14 | builder.Services.AddSingleton(); 15 | // Register the language container for Blazor Server 16 | builder.Services.AddLanguageContainerFromFolderForBlazorServer("Resources", CultureInfo.GetCultureInfo("en-US")); 17 | var app = builder.Build(); 18 | 19 | // Configure the HTTP request pipeline. 20 | if (!app.Environment.IsDevelopment()) 21 | { 22 | app.UseExceptionHandler("/Error"); 23 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 24 | app.UseHsts(); 25 | } 26 | 27 | app.UseHttpsRedirection(); 28 | 29 | app.UseStaticFiles(); 30 | 31 | app.UseRouting(); 32 | 33 | app.MapBlazorHub(); 34 | app.MapFallbackToPage("/_Host"); 35 | 36 | app.Run(); 37 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5292", 7 | "sslPort": 44306 8 | } 9 | }, 10 | "profiles": { 11 | "BlazorServerLocalizationSample": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:7019;http://localhost:5019", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: وطن 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: مرحبا ب {username} في الاختبار 5 | Question: كيف يعمل Blazor من أجلك؟ 6 | BriefSurvey: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Please: رجاءً 9 | Counter: 10 | Title: عداد 11 | ClickMe: انقر فوق "أنا" 12 | FetchData: 13 | Title: جلب البيانات 14 | WeatherForcast: توقعات الطقس 15 | WeatherTitle: يوضح هذا المكون جلب البيانات من الخادم 16 | Loading: تحميل 17 | Date: تاريخ 18 | Temp: درجة الحرارة 19 | Summary: ملخص 20 | NavMenu: 21 | About: عن 22 | BlazorServerLocalizationSample: نموذج تعريب خادم Blazor 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Дом 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли {username} в теста 5 | Question: Как работи Blazor за вас? 6 | BriefSurvey: Кратък преглед 7 | Think: Кажете ни какво мислите 8 | Please: Моля 9 | Counter: 10 | Title: Контра 11 | ClickMe: Щракнете върху мен 12 | FetchData: 13 | Title: Извличане на данни 14 | WeatherForcast: Прогноза за времето 15 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 16 | Loading: Зареждане 17 | Date: Дата 18 | Temp: Темп 19 | Summary: Резюме 20 | NavMenu: 21 | About: За 22 | BlazorServerLocalizationSample: Пример за локализация на сървъра на Blazor 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Llar 3 | HelloWorld: Hola món 4 | Welcome: Benvingut {username} a la prova 5 | Question: Com treballa Blazor per a tu? 6 | BriefSurvey: Breu enquesta 7 | Think: Explica'ns què en penses 8 | Please: Si us plau 9 | Counter: 10 | Title: Taulell 11 | ClickMe: Fes clic a mi 12 | FetchData: 13 | Title: Fetch Data 14 | WeatherForcast: Previsió 15 | WeatherTitle: Aquest component demostra la obtenció de dades del servidor 16 | Loading: Càrrega 17 | Date: Datar 18 | Temp: Temp 19 | Summary: Resum 20 | NavMenu: 21 | About: Sobre 22 | BlazorServerLocalizationSample: Exemple de localització del servidor Blazor 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Heim 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen {username} zum Test 5 | Question: Wie funktioniert Blazor bei Ihnen? 6 | BriefSurvey: Kurzer Überblick 7 | Think: Sag uns, was du denkst 8 | Please: Bitte 9 | Counter: 10 | Title: Zähler 11 | ClickMe: Klick mich 12 | FetchData: 13 | Title: Daten abrufen 14 | WeatherForcast: Wettervorhersage 15 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 16 | Loading: Laden 17 | Date: Datum 18 | Temp: Aushilfe 19 | Summary: Zusammenfassung 20 | NavMenu: 21 | About: Über 22 | BlazorServerLocalizationSample: Beispiel für die Lokalisierung von Blazor Server 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome {username} to the test 5 | Question: How is Blazor working for you? 6 | BriefSurvey: Brief Survey 7 | Think: Tell us what do you think 8 | Please: Please 9 | Counter: 10 | Title: Counter 11 | ClickMe: Click Me 12 | FetchData: 13 | Title: Fetch Data 14 | WeatherForcast: Weather forecast 15 | WeatherTitle: This component demonstrates fetching data from the server 16 | Loading: Loading 17 | Date: Date 18 | Temp: Temp 19 | Summary: Summary 20 | NavMenu: 21 | About: About 22 | BlazorServerLocalizationSample: Blazor Server Localization Sample 23 | 24 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Koti 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa {username} testiin 5 | Question: Miten Blazor toimii sinulle? 6 | BriefSurvey: Lyhyt kysely 7 | Think: Kerro meille mielipiteesi 8 | Please: Anteeksi 9 | Counter: 10 | Title: Laskuri 11 | ClickMe: Valitse Minä 12 | FetchData: 13 | Title: Hae tiedot 14 | WeatherForcast: Sääennuste 15 | WeatherTitle: Tämä komponentti osoittaa tietojen noutamisen palvelimelta 16 | Loading: Lastaaminen 17 | Date: Päivämäärä 18 | Temp: Temp 19 | Summary: Yhteenveto 20 | NavMenu: 21 | About: Noin 22 | BlazorServerLocalizationSample: Blazor-palvelimen lokalisoinnin esimerkki 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Domicile 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue {username} dans le test 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSurvey: Bref sondage 7 | Think: Dites-nous ce que vous en pensez 8 | Please: S’il vous plaît 9 | Counter: 10 | Title: Compteur 11 | ClickMe: Cliquez sur moi 12 | FetchData: 13 | Title: Récupérer des données 14 | WeatherForcast: Météo 15 | WeatherTitle: Ce composant illustre l’extraction de données à partir du serveur 16 | Loading: Chargement 17 | Date: Date 18 | Temp: Intérimaire 19 | Summary: Résumé 20 | NavMenu: 21 | About: Environ 22 | BlazorServerLocalizationSample: Exemple de localisation de serveur Blazor 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto {username} al test 5 | Question: In che modo Blazor sta lavorando per te? 6 | BriefSurvey: Breve sondaggio 7 | Think: Dicci cosa ne pensi 8 | Please: Per favore 9 | Counter: 10 | Title: Contatore 11 | ClickMe: Fai clic su di me 12 | FetchData: 13 | Title: Recupera dati 14 | WeatherForcast: Previsioni meteo 15 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 16 | Loading: Caricamento 17 | Date: Dattero 18 | Temp: Temp 19 | Summary: Sommario 20 | NavMenu: 21 | About: Circa 22 | BlazorServerLocalizationSample: Esempio di localizzazione di Blazor Server 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: 家 3 | HelloWorld: ハローワールド 4 | Welcome: テストに{username}を歓迎します 5 | Question: Blazorはどのように機能していますか? 6 | BriefSurvey: 簡易調査 7 | Think: どう思うか教えてください 8 | Please: お願いします 9 | Counter: 10 | Title: カウンター 11 | ClickMe: クリックミー 12 | FetchData: 13 | Title: データの取得 14 | WeatherForcast: 天気予報 15 | WeatherTitle: このコンポーネントは、サーバーからデータを取得する方法を示しています 16 | Loading: 積載 17 | Date: 日付 18 | Temp: 一時 19 | Summary: 概要 20 | NavMenu: 21 | About: に関しては 22 | BlazorServerLocalizationSample: Blazor Server ローカリゼーション サンプル 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: വീട് 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: ടെസ്റ്റിലേക്ക് {username} സ്വാഗതം 5 | Question: ബ്ലേസർ നിങ്ങൾക്കായി എങ്ങനെ പ്രവർത്തിക്കുന്നു? 6 | BriefSurvey: ഹ്രസ്വ സർവേ 7 | Think: നിങ്ങൾക്ക് എന്ത് തോന്നുന്നുവെന്ന് ഞങ്ങളോട് പറയുക 8 | Please: ദയവുചെയ്ത് 9 | Counter: 10 | Title: കൗണ്ടർ 11 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 12 | FetchData: 13 | Title: ഡാറ്റ നേടുക 14 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 15 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നത് പ്രദർശിപ്പിക്കുന്നു 16 | Loading: ലോഡിംഗ് 17 | Date: ഈന്തപ്പന 18 | Temp: താപനില 19 | Summary: സംഗ്രഹം 20 | NavMenu: 21 | About: കുറിച്ച് 22 | BlazorServerLocalizationSample: Blazor Server Localization Sample 23 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject ILanguageContainerService Language 3 | @Language["NavMenu:BlazorServerLocalizationSample"] 4 | 5 |
6 | 9 | 10 |
11 | 14 | 15 |
16 | @Body 17 |
18 |
19 |
20 | 21 | @code { 22 | protected override void OnInitialized() 23 | { 24 | Language.InitLocalizedComponent(this); 25 | base.OnInitialized(); 26 | } 27 | } -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth) { 36 | display: none; 37 | } 38 | 39 | .top-row.auth { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a, .top-row .btn-link { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .top-row, article { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | @using AKSoftware.Localization.MultiLanguages 2 | @using AKSoftware.Localization.MultiLanguages.Blazor 3 | @inject ILanguageContainerService Language 4 | 5 | 13 | 14 |
15 | 32 |
33 | 34 | @code { 35 | private bool collapseNavMenu = true; 36 | 37 | private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; 38 | 39 | private void ToggleNavMenu() 40 | { 41 | collapseNavMenu = !collapseNavMenu; 42 | } 43 | } 44 | 45 | @code 46 | { 47 | protected override void OnInitialized() 48 | { 49 | Language.InitLocalizedComponent(this); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | @inject ILanguageContainerService Language 2 | 12 | 13 | @code 14 | { 15 | // Demonstrates how a parent component can supply parameters 16 | [Parameter] 17 | public string? Title { get; set; } 18 | 19 | protected override void OnInitialized() 20 | { 21 | Language.InitLocalizedComponent(this); 22 | } 23 | } -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorServerLocalizationSample 10 | @using BlazorServerLocalizationSample.Shared 11 | @using AKSoftware.Localization.MultiLanguages 12 | @using AKSoftware.Localization.MultiLanguages.Blazor -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorServerLocalizationSample/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/BlazorServerLocalizationSample/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/BlazorServerLocalizationSample/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/ConsoleAppSample/ConsoleAppSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | PreserveNewest 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using AKSoftware.Localization.MultiLanguages; 3 | using AKSoftware.Localization.MultiLanguages.Providers; 4 | 5 | Console.WriteLine("Hello, World!"); 6 | 7 | ILanguageContainerService language = new LanguageContainer(new FolderResourceKeysProvider("Resources")); 8 | 9 | var value = language["HelloWorld"]; -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا {username} في التجربة 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Counter: 9 | Title: مكافحه 10 | ClickMe: انقر فوق Me 11 | FetchData: 12 | Title: جلب البيانات 13 | WeatherForcast: توقعات الطقس 14 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 15 | Loading: تحميل 16 | Date: تاريخ 17 | Temp: Temp 18 | Summary: موجز 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли {username} на теста 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Counter: 9 | Title: Counter 10 | ClickMe: Кликнете върху мен 11 | FetchData: 12 | Title: Извличане на данни 13 | WeatherForcast: Прогноза за времето 14 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 15 | Loading: Зареждане 16 | Date: Дата 17 | Temp: Temp 18 | Summary: Резюме 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Bienvenida {username} a la prueba 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Counter: 9 | Title: Taulell 10 | ClickMe: Feu clic a mi 11 | FetchData: 12 | Title: Obtén dades 13 | WeatherForcast: Previsió 14 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 15 | Loading: Càrrega 16 | Date: Data 17 | Temp: Temp 18 | Summary: Resum 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen {username} zum Test 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Counter: 9 | Title: Zähler 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Abrufen von Daten 13 | WeatherForcast: Wettervorhersage 14 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 15 | Loading: Laden 16 | Date: Datum 17 | Temp: Temp 18 | Summary: Zusammenfassung 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome {username} to the test 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Counter: 9 | Title: Counter 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Fetch Data 13 | WeatherForcast: Weather forecast 14 | WeatherTitle: This component demonstrates fetching data from the server 15 | Loading: Loading 16 | Date: Date 17 | Temp: Temp 18 | Summary: Summary 19 | 20 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa {username} testiin 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Counter: 9 | Title: Laskuri 10 | ClickMe: Valitse Minä 11 | FetchData: 12 | Title: Hae tiedot 13 | WeatherForcast: Ennuste 14 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 15 | Loading: Lastaus 16 | Date: Päivämäärä 17 | Temp: Temp 18 | Summary: Yhteenveto 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue {username} au test 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Counter: 9 | Title: Counter 10 | ClickMe: Cliquez sur moi 11 | FetchData: 12 | Title: Rechercher des données 13 | WeatherForcast: Prévisions météo 14 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 15 | Loading: Chargement 16 | Date: Date 17 | Temp: Temp 18 | Summary: Résumé 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto {username} per il test 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Counter: 9 | Title: Contatore 10 | ClickMe: Fare clic su Me 11 | FetchData: 12 | Title: Recupera dati 13 | WeatherForcast: Previsioni meteo 14 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 15 | Loading: Caricamento 16 | Date: Data 17 | Temp: Temp 18 | Summary: Riepilogo 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: テストする{username}へようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Counter: 9 | Title: カウンター 10 | ClickMe: '[私] をクリックします。' 11 | FetchData: 12 | Title: データのフェッチ 13 | WeatherForcast: 天気予報 14 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 15 | Loading: 読み込み 16 | Date: 日付 17 | Temp: 温度 18 | Summary: 概要 19 | -------------------------------------------------------------------------------- /src/ConsoleAppSample/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: परीक्षण करने के लिए आपका स्वागत है {username} 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Counter: 9 | Title: à ́à μà 10 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 11 | FetchData: 12 | Title: ഡാറ്റ കൊണ്ടുവരിക 13 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 14 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 15 | Loading: ലഭ്യമാക്കുന്നു 16 | Date: തീയതി 17 | Temp: à ́à μà 18 | Summary: സംഗ്രഹം 19 | -------------------------------------------------------------------------------- /src/TestProject1/TestProject1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | false 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | all 18 | 19 | 20 | runtime; build; native; contentfiles; analyzers; buildtransitive 21 | all 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/TestProject1/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | namespace TestProject1 2 | { 3 | public class UnitTest1 4 | { 5 | [Fact] 6 | public void Test1() 7 | { 8 | 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/TestProject1/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /src/UwpAkLocalization/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/ApplicationResourceLoader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Windows.Globalization; 7 | using Windows.UI.Xaml.Resources; 8 | using AKSoftware.Localization.MultiLanguages; 9 | 10 | namespace UwpAkLocalization 11 | { 12 | public interface IResourceLoader 13 | { 14 | string GetResourceString(string resourceId); 15 | } 16 | 17 | public class ApplicationResourceLoader : CustomXamlResourceLoader, IResourceLoader 18 | { 19 | private ILanguageContainerService Localization { get; } 20 | 21 | public ApplicationResourceLoader(ILanguageContainerService localization) 22 | { 23 | Localization = localization; 24 | } 25 | protected override object GetResource(string resourceId, string objectType, string propertyName, string propertyType) 26 | { 27 | return (object)Localization[resourceId]; 28 | } 29 | 30 | public string GetResourceString(string resourceId) 31 | { 32 | throw new System.NotImplementedException(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/StoreLogo.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/ar-SA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/ar-SA.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/bg-BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/bg-BG.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/ca-ES.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/ca-ES.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/de-DE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/de-DE.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/en-US.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/en-US.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/fi-FI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/fi-FI.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/fr-FR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/fr-FR.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/it-IT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/it-IT.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/ja-JP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/ja-JP.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/Assets/ml-IN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/src/UwpAkLocalization/Assets/ml-IN.png -------------------------------------------------------------------------------- /src/UwpAkLocalization/LocalizationKeys.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace UwpAkLocalization 8 | { 9 | public static class LocalizationKeys 10 | { 11 | public const string HomePage_HelloWorld = "HomePage:HelloWorld"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Threading.Tasks; 3 | using Windows.ApplicationModel.Resources.Core; 4 | using Windows.Globalization; 5 | using AKSoftware.Localization.MultiLanguages; 6 | using Windows.UI.Xaml; 7 | using Windows.UI.Xaml.Controls; 8 | using Windows.UI.Xaml.Media.Animation; 9 | using AKSoftware.Localization.MultiLanguages.UWP; 10 | using Microsoft.Extensions.DependencyInjection; 11 | 12 | namespace UwpAkLocalization 13 | { 14 | public sealed partial class MainPage : Page 15 | { 16 | public ILanguageContainerService Localization { get; private set; } 17 | public MainPage() 18 | { 19 | this.InitializeComponent(); 20 | SuppressPageAnimation(); 21 | Localization = ((IServiceProviderHost)Application.Current).ServiceProvider.GetService(); 22 | } 23 | 24 | private void SuppressPageAnimation() 25 | { 26 | var transitionCollection = new TransitionCollection(); 27 | var theme = new NavigationThemeTransition 28 | { 29 | DefaultNavigationTransitionInfo = new SuppressNavigationTransitionInfo() 30 | }; 31 | 32 | transitionCollection.Add(theme); 33 | Transitions = transitionCollection; 34 | } 35 | 36 | private void SetLanguage(object sender, RoutedEventArgs e) 37 | { 38 | var language = ((Button) sender).Tag.ToString(); 39 | var culture = CultureInfo.GetCultureInfo(language); 40 | Localization.SetLanguage(culture); 41 | this.Frame.Navigate(typeof(MainPage)); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | UwpAkLocalization 18 | gerfe 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UwpAkLocalization")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("UwpAkLocalization")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /src/UwpAkLocalization/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا {username} في التجربة 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Hello: بالعالم {firstname} {lastname} 9 | Counter: 10 | Title: مكافحه 11 | ClickMe: انقر فوق Me 12 | FetchData: 13 | Title: جلب البيانات 14 | WeatherForcast: توقعات الطقس 15 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 16 | Loading: تحميل 17 | Date: تاريخ 18 | Temp: Temp 19 | Summary: موجز 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли {username} на теста 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Hello: Здравей {firstname} {lastname} 9 | Counter: 10 | Title: Counter 11 | ClickMe: Кликнете върху мен 12 | FetchData: 13 | Title: Извличане на данни 14 | WeatherForcast: Прогноза за времето 15 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 16 | Loading: Зареждане 17 | Date: Дата 18 | Temp: Temp 19 | Summary: Резюме 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Bienvenida {username} a la prueba 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Hello: Hola {firstname} {lastName} 9 | Counter: 10 | Title: Taulell 11 | ClickMe: Feu clic a mi 12 | FetchData: 13 | Title: Obtén dades 14 | WeatherForcast: Previsió 15 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 16 | Loading: Càrrega 17 | Date: Data 18 | Temp: Temp 19 | Summary: Resum 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen {username} zum Test 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Hello: Hallo {firstname} {lastname} 9 | Counter: 10 | Title: Zähler 11 | ClickMe: Click Me 12 | FetchData: 13 | Title: Abrufen von Daten 14 | WeatherForcast: Wettervorhersage 15 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 16 | Loading: Laden 17 | Date: Datum 18 | Temp: Temp 19 | Summary: Zusammenfassung 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome {username} to the test 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Hello: Hello {firstname} {lastname} 9 | Counter: 10 | Title: Counter 11 | ClickMe: Click Me 12 | FetchData: 13 | Title: Fetch Data 14 | WeatherForcast: Weather forecast 15 | WeatherTitle: This component demonstrates fetching data from the server 16 | Loading: Loading 17 | Date: Date 18 | Temp: Temp 19 | Summary: Summary 20 | 21 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa {username} testiin 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Hello: Moi {firstname} {lastname} 9 | Counter: 10 | Title: Laskuri 11 | ClickMe: Valitse Minä 12 | FetchData: 13 | Title: Hae tiedot 14 | WeatherForcast: Ennuste 15 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 16 | Loading: Lastaus 17 | Date: Päivämäärä 18 | Temp: Temp 19 | Summary: Yhteenveto 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue {username} au test 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Hello: Bonjour {firstname} {lastname} 9 | Counter: 10 | Title: Counter 11 | ClickMe: Cliquez sur moi 12 | FetchData: 13 | Title: Rechercher des données 14 | WeatherForcast: Prévisions météo 15 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 16 | Loading: Chargement 17 | Date: Date 18 | Temp: Temp 19 | Summary: Résumé 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto {username} per il test 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Hello: Salve {firstname} {lastname} 9 | Counter: 10 | Title: Contatore 11 | ClickMe: Fare clic su Me 12 | FetchData: 13 | Title: Recupera dati 14 | WeatherForcast: Previsioni meteo 15 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 16 | Loading: Caricamento 17 | Date: Data 18 | Temp: Temp 19 | Summary: Riepilogo 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: テストする{username}へようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Hello: ハローワール {firstname} {lastname} 9 | Counter: 10 | Title: カウンター 11 | ClickMe: '[私] をクリックします。' 12 | FetchData: 13 | Title: データのフェッチ 14 | WeatherForcast: 天気予報 15 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 16 | Loading: 読み込み 17 | Date: 日付 18 | Temp: 温度 19 | Summary: 概要 20 | -------------------------------------------------------------------------------- /src/UwpAkLocalization/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: परीक्षण करने के लिए आपका स्वागत है {username} 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Hello: ഹലോ {firstname} {lastname} 9 | Counter: 10 | Title: à ́à μà 11 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 12 | FetchData: 13 | Title: ഡാറ്റ കൊണ്ടുവരിക 14 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 15 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 16 | Loading: ലഭ്യമാക്കുന്നു 17 | Date: തീയതി 18 | Temp: à ́à μà 19 | Summary: സംഗ്രഹം 20 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/StoreLogo.png -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksoftware98/multilanguages/18a97a9d89b9cab51b404bed9e0e9f774c410182/tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/EmbeddedResourceKeysProviderTests.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Reflection; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace AKSoftware.Localization.MultiLanguages.UWP.Tests 6 | { 7 | [TestClass] 8 | public class EmbeddedResourceKeysProviderTests : TestBase 9 | { 10 | 11 | public EmbeddedResourceKeysProviderTests() 12 | { 13 | var keysProvider = new EmbeddedResourceKeysProvider(Assembly.GetExecutingAssembly(), "Resources"); 14 | _service = new LanguageContainer(CultureInfo.GetCultureInfo("ca-ES"), keysProvider); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/ExternalFileKeysProviderTests.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Reflection; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace AKSoftware.Localization.MultiLanguages.UWP.Tests 6 | { 7 | [TestClass] 8 | public class ExternalFileKeysProviderTests : TestBase 9 | { 10 | 11 | public ExternalFileKeysProviderTests() 12 | { 13 | //************************************************************************************************* 14 | // For UWP apps the resources can be Embedded or placed in externals files - either in the app's 15 | // installation directory or the in a subfolder of the app's LocalFolder. 16 | // 17 | // Unremark the code below to test the scenarios'. Note that when you use the LocalFolder option 18 | // you will need to manually create a folder under the app's LocalFolder location and copy all of 19 | // language resource files, prior to running the app. In this case the app will be installed 20 | // in this location: 21 | // C:\Users\\AppData\Local\Packages\aaab2d02-8d02-4b44-b948-1d2c8fa9138a_3xecenf62363c\LocalState. 22 | // 23 | //************************************************************************************************* 24 | //var keysProvider = new ExternalFileKeysProvider(Assembly.GetExecutingAssembly(), "Resources", LocalizationFolderType.InstallationFolder); 25 | var keysProvider = new ExternalFileKeysProvider(Assembly.GetExecutingAssembly(), "Localization", LocalizationFolderType.LocalFolder); 26 | _service = new LanguageContainer(CultureInfo.GetCultureInfo("ca-ES"), keysProvider); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | AKSoftware.Localization.MultiLanguages.UWP.Tests 16 | gerfe 17 | Assets\StoreLogo.png 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("AKSoftware.Localization.MultiLanguages.UWP.Tests")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("AKSoftware.Localization.MultiLanguages.UWP.Tests")] 10 | [assembly: AssemblyCopyright("Copyright © 2021")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | [assembly: AssemblyMetadata("TargetPlatform","UAP")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] 18 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/ar-SA.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: المنزل 3 | HelloWorld: مرحبا بالعالم 4 | Welcome: اهلا وسهلا 5 | Question: كيف يعمل بلازور لديك؟ 6 | BriefSuvery: مسح موجز 7 | Think: أخبرنا ما رأيك 8 | Counter: 9 | Title: مكافحه 10 | ClickMe: انقر فوق Me 11 | FetchData: 12 | Title: جلب البيانات 13 | WeatherForcast: توقعات الطقس 14 | WeatherTitle: يوضح هذا المكون جلب البيانات من الملقم 15 | Loading: تحميل 16 | Date: تاريخ 17 | Temp: Temp 18 | Summary: موجز 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/bg-BG.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Начало 3 | HelloWorld: Здравей, свят 4 | Welcome: Добре дошли 5 | Question: Как работи Блазор за вас? 6 | BriefSuvery: Кратко проучване 7 | Think: Кажи ни какво мислиш 8 | Counter: 9 | Title: Counter 10 | ClickMe: Кликнете върху мен 11 | FetchData: 12 | Title: Извличане на данни 13 | WeatherForcast: Прогноза за времето 14 | WeatherTitle: Този компонент демонстрира извличане на данни от сървъра 15 | Loading: Зареждане 16 | Date: Дата 17 | Temp: Temp 18 | Summary: Резюме 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/ca-ES.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Hola món 4 | Welcome: Benvingut 5 | Question: Com està treballant Blazor per a vostè? 6 | BriefSuvery: Breu enquesta 7 | Think: Digui'ns què pensa vostè 8 | Counter: 9 | Title: Taulell 10 | ClickMe: Feu clic a mi 11 | FetchData: 12 | Title: Obtén dades 13 | WeatherForcast: Previsió 14 | WeatherTitle: Aquest component demostra l'obtenció de dades del servidor 15 | Loading: Càrrega 16 | Date: Data 17 | Temp: Temp 18 | Summary: Resum 19 | MerryChristmas: Feliz Navidad! -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/de-DE.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Startseite 3 | HelloWorld: Hallo Welt 4 | Welcome: Willkommen 5 | Question: Wie arbeitet Blazor für Sie? 6 | BriefSuvery: Kurze Übersicht 7 | Think: Sagen Sie uns, was Sie denken 8 | Counter: 9 | Title: Zähler 10 | ClickMe: Click Me 11 | FetchData: 12 | Title: Abrufen von Daten 13 | WeatherForcast: Wettervorhersage 14 | WeatherTitle: Diese Komponente veranschaulicht das Abrufen von Daten vom Server 15 | Loading: Laden 16 | Date: Datum 17 | Temp: Temp 18 | Summary: Zusammenfassung 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/en-US.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Home 3 | HelloWorld: Hello World 4 | Welcome: Welcome 5 | Question: How is Blazor working for you? 6 | BriefSuvery: Brief Survey 7 | Think: Tell us what do you think 8 | Login: Welcome {username} to the system 9 | Hello: Hello {firstname} {lastname} 10 | Counter: 11 | Title: Counter 12 | ClickMe: Click Me 13 | FetchData: 14 | Title: Fetch Data 15 | WeatherForcast: Weather forecast 16 | WeatherTitle: This component demonstrates fetching data from the server 17 | Loading: Loading 18 | Date: Date 19 | Temp: Temp 20 | Summary: Summary 21 | 22 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/fi-FI.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Kotisivu 3 | HelloWorld: Moi maailma 4 | Welcome: Tervetuloa 5 | Question: Miten Blazor voi työskennellä sinulle? 6 | BriefSuvery: Lyhyt tutkimus 7 | Think: Kerro meille, mitä mieltä olet 8 | Counter: 9 | Title: Laskuri 10 | ClickMe: Valitse Minä 11 | FetchData: 12 | Title: Hae tiedot 13 | WeatherForcast: Ennuste 14 | WeatherTitle: Tämä osa näyttää tietojen noutamisen palvelimesta 15 | Loading: Lastaus 16 | Date: Päivämäärä 17 | Temp: Temp 18 | Summary: Yhteenveto 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/fr-FR.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Accueil 3 | HelloWorld: Salut tout le monde 4 | Welcome: Bienvenue 5 | Question: Comment Blazor travaille-t-il pour vous ? 6 | BriefSuvery: Brève enquête 7 | Think: Dites-nous ce que vous pensez 8 | Counter: 9 | Title: Counter 10 | ClickMe: Cliquez sur moi 11 | FetchData: 12 | Title: Rechercher des données 13 | WeatherForcast: Prévisions météo 14 | WeatherTitle: Ce composant illustre l’extraction des données à partir du serveur 15 | Loading: Chargement 16 | Date: Date 17 | Temp: Temp 18 | Summary: Résumé 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/it-IT.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: Casa 3 | HelloWorld: Salve, mondo 4 | Welcome: Benvenuto 5 | Question: Come sta Blazor a lavorare per te? 6 | BriefSuvery: Breve indagine 7 | Think: Dicci cosa ne pensi 8 | Counter: 9 | Title: Contatore 10 | ClickMe: Fare clic su Me 11 | FetchData: 12 | Title: Recupera dati 13 | WeatherForcast: Previsioni meteo 14 | WeatherTitle: Questo componente illustra il recupero dei dati dal server 15 | Loading: Caricamento 16 | Date: Data 17 | Temp: Temp 18 | Summary: Riepilogo 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/ja-JP.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ホーム 3 | HelloWorld: ハローワールド 4 | Welcome: ようこそ 5 | Question: ブレイザはどのようにあなたのために働いていますか? 6 | BriefSuvery: 簡単な調査 7 | Think: どう思うか教えてください 8 | Counter: 9 | Title: カウンター 10 | ClickMe: '[私] をクリックします。' 11 | FetchData: 12 | Title: データのフェッチ 13 | WeatherForcast: 天気予報 14 | WeatherTitle: このコンポーネントは、サーバーからデータをフェッチする方法を示します。 15 | Loading: 読み込み 16 | Date: 日付 17 | Temp: 温度 18 | Summary: 概要 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/Resources/ml-IN.yml: -------------------------------------------------------------------------------- 1 | HomePage: 2 | Title: ഹോം 3 | HelloWorld: ഹലോ വേള്‍ഡ് 4 | Welcome: സ്വാഗതം 5 | Question: ബ്ലാസര് നിനക്ക് വേണ്ടി എങ്ങനെയാണ് ജോലി ചെയ്യുന്നത്? 6 | BriefSuvery: ചുരുക്കം സർവേ 7 | Think: നിങ്ങൾ എന്താണ് ചിന്തിക്കുന്നതെന്ന് ഞങ്ങളോട് പറയൂ 8 | Counter: 9 | Title: à ́à μà 10 | ClickMe: എന്നെ ക്ലിക്ക് ചെയ്യുക 11 | FetchData: 12 | Title: ഡാറ്റ കൊണ്ടുവരിക 13 | WeatherForcast: കാലാവസ്ഥ പ്രവചനം 14 | WeatherTitle: ഈ ഘടകം സെർവറിൽ നിന്ന് ഡാറ്റ കൊണ്ടുവരുന്നു 15 | Loading: ലഭ്യമാക്കുന്നു 16 | Date: തീയതി 17 | Temp: à ́à μà 18 | Summary: സംഗ്രഹം 19 | -------------------------------------------------------------------------------- /tests/AKSoftware.Localization.MultiLanguages.UWP.Tests/UnitTestApp.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | --------------------------------------------------------------------------------