umbraco dictionary Icon

Dictionaries in Umbraco

Dictionaries in Umbraco

What Are Dictionaries in Umbraco?

Dictionaries are key-value pairs stored in the backoffice that can be rendered on any page. They’re especially useful when:

  • You want to show the same label or message in multiple languages.

  • You want to avoid hardcoding strings in templates or views.

  • You need to centralize UI text (e.g. buttons, error messages, meta descriptions).


Common Use Cases

1. UI Labels and Buttons


<button>@Umbraco.GetDictionaryValue("cta.bookNow")</button>

Use for buttons like: “Book Now”, “Add to Cart”, “Submit”, etc.

2. 404 / Error Page Messages


<h1>@Umbraco.GetDictionaryValue("error.404.title")</h1>
<p>@Umbraco.GetDictionaryValue("error.404.description")</p>

3. SEO Metadata


<meta name="description" content="@Umbraco.GetDictionaryValue("seo.homeDescription")" />

Centralize descriptions and titles across pages that don’t require custom SEO inputs.

How to Create a Dictionary Item in Umbraco

Creating a dictionary item in Umbraco is quick and straightforward — here’s how to do it from the backoffice:

1. Go to the Settings Section

Start by opening the Umbraco Backoffice and navigating to the Settings area from the main menu.

2. Select the Translation Tab

In the Settings section, click on the “Translation” tab. This is where all your dictionary items are managed.

3. Create a New Dictionary Item

Click the “Create” button at the top or within the translation panel.

  • Enter a unique key (e.g., header.bookNow)

  • Add a translation for each available language (e.g., English: “Book Now”, Spanish: “Reservar ahora”)

4. Save

Once your values are entered, hit Save — and you're done! Your dictionary key is now ready to be used anywhere in your templates.

 

 

How to Use a Dictionary in Razor


@Umbraco.GetDictionaryValue("footer.aboutUs")

 

 

 

In summary, Umbraco Dictionaries offer a simple yet powerful way to manage consistent, multilingual text across your website. Whether you're localizing labels, error messages, or calls to action, they help streamline content management and improve editor efficiency. By centralizing your text content, you future-proof your site for scalability and translation — making Dictionaries a smart addition to any well-structured Umbraco project.

Comments

Submitting...
Your comment has been posted. Thank you!