FmgLib.Localization
1.0.1
See the version list below for details.
dotnet add package FmgLib.Localization --version 1.0.1
NuGet\Install-Package FmgLib.Localization -Version 1.0.1
<PackageReference Include="FmgLib.Localization" Version="1.0.1" />
paket add FmgLib.Localization --version 1.0.1
#r "nuget: FmgLib.Localization, 1.0.1"
// Install FmgLib.Localization as a Cake Addin #addin nuget:?package=FmgLib.Localization&version=1.0.1 // Install FmgLib.Localization as a Cake Tool #tool nuget:?package=FmgLib.Localization&version=1.0.1
To access related services, simply add using FmgLib.Localization;
statement.
In the Program.cs file,
builder.Services.AddFmgLibLocalization();
should be added.
In your main project you should have a language file of type json. The translation will be read from this file and imported. If you do not specify the path to the file(s) in the parameter (
builder.Services.AddFmgLibLocalization();
), will look for a json file named Localization.json
in the home directory.
if you give one or more parameters like
builder.Services.AddFmgLibLocalization("Localization1.json", "Localization2.json", "/Languages/Temp1.json");
it will read json files in given file paths.
Proper json format:
Instead of 'keyWord' keywords, you can use any word or phrase(s) you want. You don't have any Regex limitations.
You can also change the 'tr-TR' and 'en-US' language keys with words or sentences as you wish. But it is recommended to use expressions such as 'en-US', 'tr-TR', 'fr-FR'.
You can simply use
Console.WriteLine("keyWord 1".ToTranslate());
in the code.
If you do not specify a parameter, it will translate according to the language expression registered in Culture (language keys such as 'en-US', 'tr-TR' will appear).
You can easily obtain the translation by specifying the language key as
Console.WriteLine("keyWord 1".ToTranslate("tr-TR"));
.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Newtonsoft.Json (>= 12.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.