Search code examples
c#asp.netumbracoumbraco7umbraco-blog

Umbraco multilanguage with URL change


I am working with Umbraco v7.x. I have few static pages and they need to be added in two languages(en/da).

I know there are two ways to translate

1- Copy folder and assign different culture and hostname and add fields data according to language.

2 - Use dictionary items.

But my problem is customer wants to have custom fields on all pages so he can change static page data without having the need to ask developer. So if I use first method to change language that would also change URL which is not required for this solution.

Second I use dictionary than how can customer can change field data because he had to go to dictionary items and make any change there. This is not a problem but text needs to be formatted and this is not possible if I use dictionary items.

Any work around to this problem.

Thanks


Solution

  • I recommend using Vorto if you want a 1:1 translated site (meaning each piece of content has a translation for each language. Use dictionary items for text that was hard-coded into your template but Vorto will wrap your property editors so that you can edit each language in the same node. You can then use HasVortoValue() and GetVortoValue() instead of HasValue() and GetPropertyValue() methods that come with Umbraco. This will return the correct value based on the culture of the request. You will also need to configure Umbraco to load the multilingual content by setting a host name and associate that with a culture. You do that by selecting "Culture and Hostnames" in the contextual menu for the home node and and click "Add Domain" (you will need to have first added the language in the Settings section):

    Culture and Hostnames dialog

    Alternatively, if you want to use a subfolder for each language instead of a differeent domain (e.g. sitename.com/english instead of english.sitename.com) you can create a custom Content Finder. I have written a couple blog posts on how to do that here and here.