Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • J 445 posts 862 karma points
    Dec 11, 2019 @ 10:04
    J
    0

    How to setup/create a multi-lingual site

    I have one Umbraco site running on Umbraco 7 (max version 7.5).

    I would like to have the one site to run in two different languages. How could/should i set this up so the URL picks the language of choice?

    For each language should there be a different site at root level?

    Are there any examples I could follow?

  • Jeffrey Veer 41 posts 308 karma points
    Dec 11, 2019 @ 12:14
    Jeffrey Veer
    2

    Hi J,

    Depending on the requirements you may want a single root node or a separate node. Let me explain both scenario's below.

    If both languages of the website have the exact same content (e.g. all news items are always translated to both languages) and just some properties requires translations, you could have a single root node where properties you want to be translated can be set using a Vorto property editor.

    However, note that Umbraco 7 doesn't allow separate url segments out of the box for different languages so both languages will have the same url segments shared.

    In case both languages do have separate content, you could create two separate root nodes. This can be achieved without using packages and will allow for different url segments based on the language.

    For both situations you can configure the base url (per culture) on the root node through the 'Culture and hostnames' screen.

    I hope this guides you in the right direction, if you have any further questions let me know and I will try to help out :-).

  • J 445 posts 862 karma points
    Dec 11, 2019 @ 13:31
    J
    0

    Jefferey, that makes great sense! and thanks for a simple explanation :-). Just a few questions:

    Regarding your comment:

    "Umbraco 7 doesn't allow separate url segments out of the box for different languages so both languages will have the same url segments shared"

    1. I assume you mean if i called a page "hello" on the English site and someone in Germany decides to look at it they would see the page as hello instead of "GutenTag" (hopefully my German is correct)?

    2. If i install Vorto, how would the template know which language i am using or is this taken care by the component? I did look at the documentation but i couldnt visualise how this is being tackled.

    Finally if i have two root nodes and a single domain (www.example.com) pointing to the one installation , do i just assign www.example.com/eng and www.example.com/de to each 'Culture and Hostname' root node so this way when the appropriate URL is visited it would direct to the Eng or De site?

    Thanks again for your help

  • Jeffrey Veer 41 posts 308 karma points
    Dec 11, 2019 @ 13:40
    Jeffrey Veer
    100

    Hi J,

    You're welcome! Please find the answer to your questions below.

    1. Yes, that's correct. Let's say you have the page 'Hello' in English and 'Gutentag' in German, this will result in these url's:

      • www.example.com/en/hello
      • www.example.com/de/hello
    2. The GetVortoValue() function will take care of the current culture, or you can pass on the culture yourself if you want to get the value of a different language. From the package page:

      The signatures to these methods are very similar to the built in Umbraco ones, with the addition of a new parameter cultureName, which allows you to choose which translation of the value you want to return. Of course, if you don't provide a cultureName, the current sites culture will be used by default.

    3. That's correct! You can assign relative paths as well, so I would recommend to set the culture and hostname to '/en' and '/de', this way the installation won't require different configurations after deploying to acceptance for example. By setting this value, the path will automatically set the culture to the one configured.

    Cheers,

Please Sign in or register to post replies

Write your reply to:

Draft