Copied to clipboard

Flag this post as spam?

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


  • David Zweben 265 posts 749 karma points
    Feb 20, 2018 @ 21:05
    David Zweben
    0

    Thoughts on a new 1:1 Multilingual approach?

    With Umbraco v8 and its Variants support apparently not coming any time soon, I've been investigating ways to implement a 1:1 multilingual Umbraco site without relying on any plugins.

    I've put together a prototype that I believe implements a new approach, and I wanted to see what fellow Umbraco users thought about it.

    What I did is set a site up, via Culture and Hostnames settings, so that the user can request a translated page by visiting the main (English) version of the page through a language-specific URL. This sets the desired language as the page's culture. Each English node has a “Translations” folder under it, containing a “Translation” node for each language, that stores translated text. The 'English' node then uses a custom method which looks at the culture setting and returns the correct node from which to access translated content, and the page pulls in text-based content from this node. This transforms the English page into a translated page. Non-text-based properties are accessed normally, and thus shared between all versions of a page.

    I set up a "Saved" ApplicationEventHandler to automatically create the necessary “Translations” and “Translation” sub-nodes when an English page is created.

    Using the custom method, about 6 lines of extra code are required to output things like breadcrumb bars and navigation lists, which I think is not bad. Dictionary items work automatically based on the culture setting, and no special URL routing or rewriting is needed. Dynamic XML sitemaps and Examine also work as expected without any extra code.

    What do you think? Does this seem like a good approach?

    Thanks,
    David

  • Geofrey 40 posts 161 karma points
    Feb 21, 2018 @ 00:13
    Geofrey
    0

    Hii bro I am looking on how to create multi language site in umbraco, can you provide some tutorials? Thanks

  • David Zweben 265 posts 749 karma points
    Feb 21, 2018 @ 00:31
    David Zweben
    0

    Hi Geofrey,

    I wouldn't suggest using my approach if you're new to Umbraco, as it requires the use of custom code that makes outputting data a bit more complex. Instead, I would take a look at this example site and try the approach it uses:

    https://github.com/jbreuer/1-1-multilingual-example

Please Sign in or register to post replies

Write your reply to:

Draft