Our.Umbraco.DictionaryBuilder 1.0.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package Our.Umbraco.DictionaryBuilder --version 1.0.11
NuGet\Install-Package Our.Umbraco.DictionaryBuilder -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="Our.Umbraco.DictionaryBuilder" Version="1.0.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Our.Umbraco.DictionaryBuilder --version 1.0.11
#r "nuget: Our.Umbraco.DictionaryBuilder, 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 Our.Umbraco.DictionaryBuilder as a Cake Addin
#addin nuget:?package=Our.Umbraco.DictionaryBuilder&version=1.0.11

// Install Our.Umbraco.DictionaryBuilder as a Cake Tool
#tool nuget:?package=Our.Umbraco.DictionaryBuilder&version=1.0.11

Umbraco.DictionaryBuilder

An Umbraco-CMS strongly typed dictionary item builder

Nuget

Usage

All dictionary models are properties in the Umbraco.Web.Dictionaries class, with a name matching the dictionary item key.

To write a dictionary item value in a Razor file, just write

Example dictionary value: "Apple"

@Dictionaries.Apple
// Returns: "Apple"

Dictionary values are return in Thread.CurrentUICulture, unless another culture is specified in the Format extension methods.

Format extension methods

In namespace Umbraco.DictionaryBuilder.Extensions

string Format(params object[] args)

Example dictionary value: "{0} apple"

@Dictionaries.Apple.Format("green")
// Returns: "green apple"

Equivalent to @string.Format(Dictionaries.Apple)

string Format(int count, params object[] args)

A pluralization method

Example dictionary value "no apples|one apple|{count} apples"

@Dictionaries.Apple.Format(0)
// Returns: "no apples"
@Dictionaries.Apple.Format(1)
// Returns: "one apple"
@Dictionaries.Apple.Format(2)
// Returns: "2 apples"
@Dictionaries.Apple.Format(33)
// Returns: "33 apples"

Example dictionary value: "no {0} apples | one {0} apple | {count} {0} apples"

@Dictionaries.Apple.Format(0, "red")
// Returns: "no red apples"
@Dictionaries.Apple.Format(1, "red")
// Returns: "one red apple"
@Dictionaries.Apple.Format(2, "red")
// Returns: "2 red apples"
@Dictionaries.Apple.Format(33, "red")
// Returns: "33 red apples"
string Format(CultureInfo culture, params object[] args)

Like string Format(params object[] args), but returns the tranlated value of the requested culture.

string Format(CultureInfo culture, int count, params object[] args)

Like string Format(int count, params object[] args), but returns the tranlated value of the requested culture.

Configuration

AppSettings

Umbraco.DictionaryBuilder.ModelsMode

Valid values: LiveAppData

Default value: LiveAppData

Note: More modes are in the pipeline.

Umbraco.DictionaryBuilder.DictionaryNamespace

The namespace in witch the dictionary models will be generated.

Default value: Umbraco.Web

Umbraco.DictionaryBuilder.DictionaryItemsPartialClassName

The name of the partial class that contains all the generated dictionary models.

Default value: Dictionaries

Umbraco.DictionaryBuilder.DictionaryDirectory

The relative path to the folder where to generate the dictionary models

Default value: ~/App_Data/Dictionaries

Umbraco.DictionaryBuilder.AcceptUnsafeModelsDirectory

An indicator of whether is accepted to generate dictionary models in a folder outside of the current project.

Valid values: True/False

Default value: False

Umbraco.DictionaryBuilder.UseNestedStructure

Todo: Write documentation

Valid values: True/False

Default value: False

Umbraco.DictionaryBuilder.GenerateFilePerDictionaryItem

An indicator of whether the dictionary models should be generated in a single file or a file per dictionary item.

Valid values: True/False

Default value: False

Umbraco.DictionaryBuilder.Enable

An indicator of whether the DictionaryBuilder is enabled.

Valid values: True/False

Default value: False

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Our.Umbraco.DictionaryBuilder:

Package Downloads
Our.Umbraco.DictionaryBuilder.VueI18N

A handler to export Umbraco-CMS dictionary item in VueI18N format

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.15 1,393 2/10/2022
1.0.14 1,452 10/19/2021
1.0.13 4,211 1/20/2021
1.0.12 3,654 10/2/2020
1.0.11 2,773 8/22/2020
1.0.10 621 8/22/2020
1.0.9 478 8/21/2020
1.0.8 419 8/21/2020
1.0.7 402 8/21/2020
1.0.6 371 8/21/2020
1.0.5 821 8/10/2020
1.0.4 428 8/10/2020
1.0.3 595 8/10/2020
1.0.2 443 8/7/2020
1.0.1 807 8/6/2020