Our.Umbraco.DictionaryBuilder
1.0.11
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
<PackageReference Include="Our.Umbraco.DictionaryBuilder" Version="1.0.11" />
paket add Our.Umbraco.DictionaryBuilder --version 1.0.11
#r "nuget: Our.Umbraco.DictionaryBuilder, 1.0.11"
// 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
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
- UmbracoCms.Core (>= 8.2.1 && < 9.0.0)
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,442 | 2/10/2022 |
1.0.14 | 1,565 | 10/19/2021 |
1.0.13 | 4,761 | 1/20/2021 |
1.0.12 | 3,865 | 10/2/2020 |
1.0.11 | 2,956 | 8/22/2020 |
1.0.10 | 650 | 8/22/2020 |
1.0.9 | 509 | 8/21/2020 |
1.0.8 | 449 | 8/21/2020 |
1.0.7 | 430 | 8/21/2020 |
1.0.6 | 403 | 8/21/2020 |
1.0.5 | 867 | 8/10/2020 |
1.0.4 | 459 | 8/10/2020 |
1.0.3 | 635 | 8/10/2020 |
1.0.2 | 470 | 8/7/2020 |
1.0.1 | 862 | 8/6/2020 |