LazyApiPack.Localization
0.2.1.1
dotnet add package LazyApiPack.Localization --version 0.2.1.1
NuGet\Install-Package LazyApiPack.Localization -Version 0.2.1.1
<PackageReference Include="LazyApiPack.Localization" Version="0.2.1.1" />
paket add LazyApiPack.Localization --version 0.2.1.1
#r "nuget: LazyApiPack.Localization, 0.2.1.1"
// Install LazyApiPack.Localization as a Cake Addin #addin nuget:?package=LazyApiPack.Localization&version=0.2.1.1 // Install LazyApiPack.Localization as a Cake Tool #tool nuget:?package=LazyApiPack.Localization&version=0.2.1.1
About this project
This project provides interfaces, to use the Localization Manager in MVVM Service patterns.
Localization Interface
Supports functions GetTranslation
GetTranslation(group, id)
Gets the localization from the Group with the Id (See file structure).SetTranslation(group, id, value)
Sets or updates the localization in the specified Group with the Id.
Localization File Structure
Header
The localization file has a header with the following attributes
- ModuleId: Specifies the unique name of the module this localization file supports
- IsDefault: If the module does not support the selected language, this file is used instead (Usually english)
- Priority: You can write localization files for modules that are already translated. If you want to override existing localizations in other modules, you can set a higher priority to use your translations instead
- LocalizedLanguageName: The name of the language in the native language (eg. Norsk (Bokmål))
- DefaultLanguageName: The name of the language in the default language (Usually in english)
- LanguageCode: The code for the localization (de, en, etc.) Note: en-US is a different language than en-UK, so the language files will not be mixed but the default localization file is selected if the module does not explicitly supports en-US
- IsRightToLeft: Indicates, if the language should be written from right to left (eg. Hebrew or Arabic)
Localizations
The following section "Localization" contains a dictionary of translations used in your program. The hierarchy is "Group" then "Id"
Example of a localization file
{
"ModuleId": "AccountingModule",
"LanguageCode": "en",
"IsDefault": true,
"Priority": 0,
"DefaultLanguageName": "English",
"LocalizedLanguageName": "English",
"IsRightToLeft": false,
"Translations": {
"CaptionsAcc": {
"SaveFileDialogCaption": "Save accounting file",
"OpenFileDialogCaption": "Open accounting file"
},
"MessagesAcc": {
"SaveFileDialogMessage": "Do you want to save the accounting file?",
"OpenFileDialogMessage": "Do you want to open the accounting file?"
}
}
}
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
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on LazyApiPack.Localization:
Package | Downloads |
---|---|
LazyApiPack.Localization.Manager
Provides a way to localize applications. |
|
LazyApiPack.Localization.Wpf
Provides a way to use the LocaliationService within XAML files. |
|
LazyApiPack.Mvvm
Provides an MVVM pattern for applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Support added for language files as Embedded Resources from Assemblies.