rskibbe.I18n.Ini 1.0.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package rskibbe.I18n.Ini --version 1.0.11                
NuGet\Install-Package rskibbe.I18n.Ini -Version 1.0.11                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="rskibbe.I18n.Ini" Version="1.0.11" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add rskibbe.I18n.Ini --version 1.0.11                
#r "nuget: rskibbe.I18n.Ini, 1.0.11"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install rskibbe.I18n.Ini as a Cake Addin
#addin nuget:?package=rskibbe.I18n.Ini&version=1.0.11

// Install rskibbe.I18n.Ini as a Cake Tool
#tool nuget:?package=rskibbe.I18n.Ini&version=1.0.11                

Description

A package with default Ini 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 Ini 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.Ini):

    Translator.Builder
        .Build()
        .StoreInstance();

This will take the Ini 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
        • ini
          • languages.ini
          • en-US_English.ini
          • de-DE_Deutsch.ini

languages.ini

This file represents/contains all available languages for your application - remember, in Ini format. Matching example contents to the example from above could look like this:

[English]
Iso=en-US
Name=English

[Deutsch]
Iso=de-DE
Name=Deutsch

I specified the german and english language over here. Each one with a name and an iso "property". The section header content doesn't really matter - more or less. Empty lines get ignored.

Translation files

Next, we will take a look at the translation files like "en-US_English.ini" 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.ini
[en-US_English]
key1=Actions
greeting=Hello!
de-DE_Deutsch.ini
[de-DE_Deutsch]
key1=Aktionen
greeting=Hallo!

The section headers get ignored, but I think it feels right to provide them anyways, because this is just how a normal Ini would look like, right? But feel free to omit them. The corresponding translation key would be "key1", which would result in "Actions" or "Aktionen" depending on the language.

Take a look at the base package for more information like getting the available languages, changing the language, etc.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.16 64 11/1/2024
1.0.15 171 9/4/2023
1.0.14 263 2/1/2023
1.0.13 255 12/19/2022
1.0.12 354 10/29/2022
1.0.11 324 10/29/2022
1.0.10 332 10/29/2022
1.0.9 335 10/29/2022
1.0.8 337 10/28/2022
1.0.7 338 10/28/2022
1.0.6 325 10/27/2022
1.0.5 348 10/27/2022
1.0.4 340 10/25/2022
1.0.3 366 10/25/2022
1.0.2 344 10/24/2022
1.0.1 324 10/24/2022
1.0.0 345 10/24/2022