Copied to clipboard

Flag this post as spam?

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


  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 14, 2017 @ 14:46
    Frans de Jong
    0

    Override Culture for 1-1 translation

    Hi guys,

    I'm a little lost again. A client of u wants to have 2 different languages on the same node. I made a class that inherits UmbracoApplication and added a Application_Beginrequest. This code does run and it does set the culture to the correct culture.

    After the code changes the culture, umbraco changes it to some default for no apparent reason. I have the rootnode culture set to inherit.

    I found a lot of possible clues but all are for Umbraco 6 or below.

    Can someone point me in the right direction?

    Thanks

    Edit: For now I've build a helper that switches the culture from every view. It works but the dictionary returns nothing anymore...

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 15, 2017 @ 07:30
    Dave Woestenborghs
    101

    Hi Frans,

    Have a look at this post by my colleague Jeroen Breuer : http://24days.in/umbraco-cms/2015/multilingual-vorto-nested-content/

    He explains setting up 1-on-1 with the use of vorto. He has also created a sample project with example code.

    Dave

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 15, 2017 @ 08:18
    Frans de Jong
    0

    Thanks Dave,

    I've looked in to this. Will this work without vorto to? The client rejected vorto for this project and she wanted to habe multiple content tabs.

    Frans

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 15, 2017 @ 09:41
    Dave Woestenborghs
    0

    Hi Frans

    It probably work without vorto but you need to do some coding.

    The client rejected vorto for this project and she wanted to habe multiple content tabs.

    What was the reason for this. IMHO vorto is the best solution for 1-on-1 multilanguage sites at the moment. Maybe you still can try to convince her that her choice is not the best solution.

    Dave

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 15, 2017 @ 10:13
    Frans de Jong
    0

    They didn't want the hidden languages. So everything has to be shown on a separate tab.

    Is it possible to use vorto like a separate content tab? So not the visible tab but wrap it around the grid with or without doctype grid editor for example?

    So use it like some sort of wrapper? That would make it a lot easier to convince them.

    Frans

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 15, 2017 @ 10:24
    Dave Woestenborghs
    1

    Hi Frans,

    Read the article from Jeroen. He explains how we make all properties on a tab a nested content doctype. So switching languages is like switching tabs.

    Dave

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 16, 2017 @ 15:43
    Frans de Jong
    0

    Hi Dave,

    We've decided to go with your solution but I ran into a problem straight away... Did you ever use the grid in this solution? When I switch languages it doesn't rerender the richtext editors in the grid.

    Frans

    Edit: The error I get

    TypeError: Cannot read property 'getContent' of null
    at umbraco.directives.js?cdv=1581952791:3833
    at Object.$broadcast (angular.min.js?cdv=1581952791:94)
    at nestedcontent.directives.js?cdv=1581952791:23
    at Object.$broadcast (angular.min.js?cdv=1581952791:94)
    at updateModel (nestedcontent.controllers.js?cdv=1581952791:364)
    at nestedcontent.controllers.js?cdv=1581952791:395
    at Object.$broadcast (angular.min.js?cdv=1581952791:94)
    at vorto.js?cdv=1581952791:402
    at Object.$broadcast (angular.min.js?cdv=1581952791:94)
    at vorto.js?cdv=1581952791:196
    
  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 16, 2017 @ 15:55
    Dave Woestenborghs
    1

    Hi Frans,

    Haven't seen this one.

    dave

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 16, 2017 @ 16:54
    Frans de Jong
    0

    Ok, thanks. I'll try and reproduce this issue in a empty solution.

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 17, 2017 @ 08:36
    Frans de Jong
    0

    Ok, this solution isn't working with the grid.

    What I did:

    1. Download and run the demo solution.
    2. Change the richtext editor in NewsDetached to Contentgrid
    3. Go to content and fill Dutch and English
    4. Switch between languages.

    The result is a broken rte in the grid (screenshot). Do you know or can you ask Jeroen if there is a easy fix?

    If you need more info please ask. I'm getting desperate looking for a 1-1 multilingual solution.

    Thanks Frans

    enter image description here

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 17, 2017 @ 08:40
    Dave Woestenborghs
    1

    Hi Frans,

    this is probably because the grid is used inside Nested Content. Have yout tried if that works without vorto ?

    Dave

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 17, 2017 @ 08:51
    Frans de Jong
    0

    I added a tab to the newsitem with a datatype nestedcontent. In there I've put the NewsDetached wit the grid. In the content section I made 2 items with nested content and filled the grid with content. After that I started switching between items and everything kept working.

    So it seems to be a nestedcontent -> vorto -> grid combination.

    I'll go and try if grid works in Vorto without nested content.

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 17, 2017 @ 08:53
    Frans de Jong
    0

    It seems to be a grid in vorto issue...

    I'll post it in the vorto section. Thanks for the help!

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 17, 2017 @ 09:09
  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 17, 2017 @ 09:17
    Dave Woestenborghs
    0

    Nice...gonna bookmark that one myself.

    Dave

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 17, 2017 @ 09:40
  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 17, 2017 @ 10:22
    Frans de Jong
    0

    Yep,

    The only thing that needed to be fixed is one line in the nested content css:

    .nested-content__content .umb-control-group { padding-bottom: 0; }

    This fixes the grid going over the pagetitle.

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 21, 2017 @ 07:33
    Frans de Jong
    0

    Hi Dave, Jeroen,

    I've got the Extensions project up and running without any build errors.

    Something strange is happening... When I start the application I get a 404 straight away on the homepage. When I log in to umbraco I see the document is published but not in cache.

    Url preview shows me a #. Can you please tell me where to look to solve this problem?

    Thanks for the help!!

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 21, 2017 @ 08:10
    Frans de Jong
    0

    I've made a few extra changes to see where it could go wrong.

    I've added a url http://localhost:57700 to the culture and hostname of the rootnode. This changed the # in url preview to a url. The url still gives a 404 so no help there.

    I've noticed in the demo project that you use documenttype inheritance and not composition. Also I noticed that in the MultilingualUrlProvider.cs you do the following:

    var content = umbracoContext.ContentCache.GetById(id) as UmbMaster;

    In my case with compositions I do the following:

    var content = umbracoContext.ContentCache.GetById(id) as BaseProperties; This always returns null

    If I leave out the as BaseProperties it gives back the rootnode.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 21, 2017 @ 08:56
    Jeroen Breuer
    0

    Hi Frans,

    Are you talking about the 1-1 Multilingual example? https://github.com/jbreuer/1-1-multilingual-example

    The example project always needs to have the domains added to the highest node. In this case the homepage. See this comment: https://github.com/jbreuer/1-1-multilingual-example/blob/master/Sources/Umbraco.Extensions/UrlProviders/MultilingualUrlProvider.cs#L132

    Maybe first try to make it work without compositions. This project uses a starter kit which was using the documenttype inheritance already.

    Did you watch the video? https://www.youtube.com/watch?v=DWjbJiIUQdk

    Jeroen

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 21, 2017 @ 09:02
    Frans de Jong
    1

    Yep, thats the example I'm using.

    I have to incorporate it in a site that uses compositions so I have to get it to work with compositions. I didn't see the video. I'll look in to that.

    It looks like I got the homepage working now, at least the url provider. Now I have to get the contentfinder up and running.

    This is so much fun if the deadline wasn't so close.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Feb 21, 2017 @ 08:55
    Dave Woestenborghs
    0

    Hi Frans,

    Is you "BaseProperties" a composition ?

    Dave

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 21, 2017 @ 08:59
    Frans de Jong
    0

    Yep, its a composition.

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 21, 2017 @ 10:55
    Frans de Jong
    0

    Victory!!!

    I got it all working.

    I'm going to copy everything to my existing site now. That is a multisite Umbraco install.

    When everything works I'm going to tidy up my code and share it somehow.

    Only one mistery remains... I don't get access to DeepCloneRuntimeCacheProvider when I add my own class. If I copy your project it works like a charm. Where have you set the access to the internal class?

    Thanks guys!!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 21, 2017 @ 11:51
    Jeroen Breuer
    0

    You don't need the DeepCloneRuntimeCacheProvider. It's a piece of legacy code. It was fixed in Umbraco 7.4.2, but at the time this project was still at 7.3. More info here: http://issues.umbraco.org/issue/U4-8027

    You can just remove the CustomBootManager class.

    Jeroen

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 21, 2017 @ 11:53
    Frans de Jong
    0

    Ok, thanks

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 21, 2017 @ 21:26
    Frans de Jong
    0

    Since I moved everything to my own project. I suddenly have a url that is "*1060" so star and rootId in my case.

    Any clue where that may come from? I don't know when It started to appear. It shows in the UrlPreview as well.

    I stopped the unwanted behaviour by doing domains.RemoveAll(x=>x.StartsWith("*")) in the MultilingualUrlProvider

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 22, 2017 @ 17:24
    Frans de Jong
    0

    I got the multisite working to. The backend aswell as the frontend. and I've build a dynamic language menu.

    Love how your example project pulled me to a new level. H5YR!!!

    When Carnaval is over I'll go and clean and document the code and filter out everything that has nothing to do with the multilingual urls and upload the project to git.

    Thanks Dave and Jeroen!!

Please Sign in or register to post replies

Write your reply to:

Draft