An Umbraco-CMS strongly typed dictionary item builder
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.
In namespace Umbraco.DictionaryBuilder.Extensions
Example dictionary value: "{0} apple"
@Dictionaries.Apple.Format("green")
// Returns: "green apple"
Equivalent to @string.Format(Dictionaries.Apple)
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"
Like string Format(params object[] args), but returns the tranlated value of the requested culture.
Like string Format(int count, params object[] args), but returns the tranlated value of the requested culture.
Valid values:
LiveAppDataDefault value:
LiveAppData
Note: More modes are in the pipeline.
The namespace in witch the dictionary models will be generated.
Default value:
Umbraco.Web
The name of the partial class that contains all the generated dictionary models.
Default value:
Dictionaries
The relative path to the folder where to generate the dictionary models
Default value:
~/App_Data/Dictionaries
An indicator of whether is accepted to generate dictionary models in a folder outside of the current project.
Valid values:
True/FalseDefault value:
False
Todo: Write documentation
Valid values:
True/FalseDefault value:
False
An indicator of whether the dictionary models should be generated in a single file or a file per dictionary item.
Valid values:
True/FalseDefault value:
False
An indicator of whether the DictionaryBuilder is enabled.
Valid values:
True/FalseDefault value:
False