All pages
Powered by GitBook
1 of 1

Loading...

Dictionary Items

Creating Dictionary Items in Umbraco

Depending on how your site is set up, not all content is edited through the Content section. There might be some text in your templates that needs translation. Using Dictionary Items, you can store a value for each language. Dictionary Items have a unique key that is used to fetch the value of the Dictionary Item.

Dictionary Items can be managed from the Translation section. Let's take a look at an example. In this example, we will translate "Welcome to Umbraco" from within the template and add it to the dictionary:

Adding a Dictionary Item

To add a Dictionary Item:

  1. Go to the Translation section.

  2. Click on Dictionary in the Translation tree and select Create.

  3. Enter the Name for the dictionary item. Let's say Welcome.

  4. Enter the values for the different language versions.

Grouping Dictionary Items

To group dictionary items:

  1. Go to the Translation section.

  2. Click on Dictionary in the Translation tree and select Create.

  3. Enter the Name for the dictionary item. Let's say Contact.

  4. Click Create

Editing Dictionary Items

To edit a dictionary item, follow these steps:

  1. Go to the Translation section.

  2. Use the Dictionary tree to locate the item you need to update/edit.

    • Alternatively, you can use the search field in the top-right corner.

  3. Make the edits you need to make.

It will only be possible to edit the language(s) that the given user has access to. The value of the remaining languages will be read-only.

Which language a user has access to is determined by the "Language permissions" set on the User Group. Learn more about this feature in the article.

Fetching Dictionary Values in the Template

To fetch dictionary values in the template, replace the text with the following snippet:

Alternatively, you can specify an altText which will be returned if the dictionary value is empty.

Importing and exporting Dictionary Items

In some cases, you might want to use the same Dictionary Items on multiple Umbraco websites. For this, you can use the export and import functionality to quickly copy the items from one website to another.

Exporting Dictionary Items

  1. Go to the Translation section in the Umbraco backoffice.

  2. Locate the Dictionary Item (or group) you want to copy in the section tree.

  3. Click ... next to the Dictionary item (or group).

  4. Select Export....

This will download a .udt file which you can use to import the Dictionary items on another Umbraco website.

Importing Dictionary Items

  1. Go to the Translation section in the Umbraco backoffice.

  2. Click ... next to the Dictionary tree.

  3. Select Import....

  4. Click on Import.

The Dictionary Items have now been added to your website.

Using Dictionary Item in a Multilingual website

To use Dictionary Items in a multilingual website, see the article.

Related Links

  • Click Save.

  • .
  • Click on Contact and select Create.

  • Enter the Name of the item to be created under the Contact group.

  • Click Create.

  • Enter the values for the different language versions.

  • Click Save.

  • Click Save to save the changes.

    Decide whether you want to also include descendants.

  • Click Export.

  • Find and select the .udt file containing the Dictionary Items.

  • Click Open in the file browser.

  • Review the Dictionary Items for import.

  • Choose where to import the items.

  • Click on Import.

  • Users
    Creating a Multilingual Site
    API reference for the DictionaryItem
    Localization Service
    Creating a Multilingual Site
    Rendering dictionary item
    Rendering dictionary item
    Options menu with the Export feature
    Review the Dictionary Items for import before confirming
    @Umbraco.GetDictionaryValue("Welcome")
    @Umbraco.GetDictionaryValueOrDefault("Welcome", "Another amazing day in Umbraco")