rskibbe.I18n.Json
1.0.7
See the version list below for details.
dotnet add package rskibbe.I18n.Json --version 1.0.7
NuGet\Install-Package rskibbe.I18n.Json -Version 1.0.7
<PackageReference Include="rskibbe.I18n.Json" Version="1.0.7" />
paket add rskibbe.I18n.Json --version 1.0.7
#r "nuget: rskibbe.I18n.Json, 1.0.7"
// Install rskibbe.I18n.Json as a Cake Addin #addin nuget:?package=rskibbe.I18n.Json&version=1.0.7 // Install rskibbe.I18n.Json as a Cake Tool #tool nuget:?package=rskibbe.I18n.Json&version=1.0.7
Description
A package with default JSON implementations for rskibbe.I18n.
Getting started
If you followed the steps from the base package, you are ready to provide your custom translations. For this, you need to create a specific folder structure, as this package works with JSON files.
A quick translator setup recap
To setup your custom translator just go ahead and use this quick method (if you've installed rskibbe.I18n & rskibbe.I18n.Json):
Translator.Builder
.Build()
.StoreInstance();
This will take the Json package with the autodetection mode and you don't need to configure much more.
Remember to do this "bestly" before any UI going on, the Bootstrapping point Program.cs/Program.vb or like the first Form Constructor could be the best place (but make sure it doesn't get called multiple times).
Creating the folder structure
Inside your output directory (where the finished exe resides, like bin/debug..), create this folder structure.
- bin
- debug
- i18n
- json
- languages.json
- en-US_English.json
- de-DE_Deutsch.json
- json
- i18n
- debug
languages.json
This file represents/contains all available languages for your application - remember, in JSON format. Matching example contents to the example from above could look like this:
[{"iso": "de-DE", "name": "Deutsch"},{"iso": "en-US", "name": "English"}]
I specified the german and english language over here. Each one with a name and an iso "property".
Translation files
Next, we will take a look at the translation files like "en-US_English.json" from above. As you can see, you need to first mention the iso code (should correspond to your language file of course!). Then you just append an underscore with the specific language name.
The corresponding files from above would look like this:
Simple
en-US_English.json
{"key1": "Actions", "greeting": "Hello!"}
de-DE_Deutsch.json
{"key1": "Aktionen", "greeting": "Hallo!"}
The corresponding translation key would be "key1", which would result in "Actions" or "Aktionen" depending on the language.
Namespaces / nested
en-US_English.json
{"frmMain": {"tsmiActions": "Actions"}}
de-DE_Deutsch.json
{"frmMain": {"tsmiActions": "Aktionen"}}
The corresponding translation key would be "frmMain.tsmiActions", which is a "namespaced" / nested one.
Take a look at the base package for more information like getting the available languages, changing the language, etc.
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
- Newtonsoft.Json (>= 13.0.1)
- rskibbe.I18n (>= 1.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.19 | 45 | 11/1/2024 |
1.0.18 | 264 | 9/4/2023 |
1.0.17 | 140 | 9/4/2023 |
1.0.16 | 259 | 2/1/2023 |
1.0.15 | 328 | 11/14/2022 |
1.0.14 | 379 | 10/30/2022 |
1.0.13 | 373 | 10/30/2022 |
1.0.12 | 372 | 10/29/2022 |
1.0.11 | 373 | 10/29/2022 |
1.0.10 | 362 | 10/29/2022 |
1.0.9 | 367 | 10/29/2022 |
1.0.8 | 346 | 10/29/2022 |
1.0.7 | 357 | 10/28/2022 |
1.0.6 | 387 | 10/27/2022 |
1.0.5 | 381 | 10/27/2022 |
1.0.4 | 372 | 10/25/2022 |
1.0.3 | 368 | 10/24/2022 |
1.0.2 | 365 | 10/24/2022 |
1.0.1 | 383 | 10/24/2022 |
1.0.0 | 369 | 10/24/2022 |