Copied to clipboard

Flag this post as spam?

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


  • Petra van Hees 4 posts 34 karma points
    Nov 14, 2018 @ 10:09
    Petra van Hees
    0

    Translation Manager, create translation set does not show languages

    Hi,

    Running the latest version of TM (2.1.3) on Umbraco version 7.9.2

    I installed the translation manager in an existing Umbraco installation to try it out. There are two sites for two different url's, each site already has two or three language sites (English, Dutch, French). There are five languages installed in the site, but not all are used.

    When trying to select a master site for a translation set, I cannot select a target language. The dropdown is empty and so is the radiobutton under 'languages assigned to this node'.

    When looking at the request when trying to select a node (/umbraco/backoffice/TranslationManager/TranslationSetApi/GetContentInfo/1742) I get the following response:

    [{"lcid":1043,"name":"nl-NL","displayName":"Dutch (Netherlands)","twoLetterISOLanguageName":"nl","threeLetterISOLanguageName":"nld","threeLetterWindowsLanguageName":"NLD"}]

    We also installed the translation manager in a new, empty umbraco site and it works there.

    How can we get this to work? Is there some setting we're missing?

    Thanks, Petra

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Nov 14, 2018 @ 10:31
    Kevin Jump
    0

    Hi Petra,

    are there any errors in the Chrome developer console ?

    Alongside the all to GetContentInfo, there should be a call to GetInstalledCultures (/umbraco/backoffice/TranslationManager/TranslationSetApi/GetInstalledCultures)

    This gets the languages for the dropdown, could you check and see if that returning anything ?

    Kevin

  • Petra van Hees 4 posts 34 karma points
    Nov 14, 2018 @ 10:56
    Petra van Hees
    0

    Hi Kevin,

    There are no errors in the Chrome developer console.

    GetInstalledCultures returns

    [{"lcid":4096,"name":"en-NL","displayName":"English (Netherlands)","twoLetterISOLanguageName":"en","threeLetterISOLanguageName":"eng","threeLetterWindowsLanguageName":"ZZZ"},{"lcid":1043,"name":"nl-NL","displayName":"Dutch (Netherlands)","twoLetterISOLanguageName":"nl","threeLetterISOLanguageName":"nld","threeLetterWindowsLanguageName":"NLD"},{"lcid":2060,"name":"fr-BE","displayName":"French (Belgium)","twoLetterISOLanguageName":"fr","threeLetterISOLanguageName":"fra","threeLetterWindowsLanguageName":"FRB"},{"lcid":2067,"name":"nl-BE","displayName":"Dutch (Belgium)","twoLetterISOLanguageName":"nl","threeLetterISOLanguageName":"nld","threeLetterWindowsLanguageName":"NLB"},{"lcid":4096,"name":"en-BE","displayName":"English (Belgium)","twoLetterISOLanguageName":"en","threeLetterISOLanguageName":"eng","threeLetterWindowsLanguageName":"ZZZ"}]

    Petra

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Nov 14, 2018 @ 11:48
    Kevin Jump
    100

    Hi Petra,

    I think the issue is being caused, because something in your solution is forcing all c# -> json serialization to be done in camelCase - and this part of translation manager is expecting it in PascalCase. (so you can see the returned json has a "displayName" value - the TM javascript is expecting "DisplayName" and so it doesn't display.)

    more than likely there is a place in the project doing this (or similar):

    GlobalConfiguration.Configuration
          .Formatters
          .JsonFormatter
          .SerializerSettings
          .ContractResolver = new CamelCasePropertyNamesContractResolver();
    

    Which forces camelCase across the whole project. I think there are things we can do in translation manager to mitigate this, and we are looking at them, but I think this setting can also play havoc with other bits of umbraco so its worth checking.

  • Petra van Hees 4 posts 34 karma points
    Nov 14, 2018 @ 12:25
    Petra van Hees
    0

    Hi Kevin,

    Thank you, that was indeed the case. I changed it to DefaultContractResolver and it works. The languages now appear both under 'languages assigned to this node' and in the dropdown.

    We can now start testing this :)

    Petra

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Nov 14, 2018 @ 12:27
    Kevin Jump
    0

    Cool,

    Just a note - as we were testing/debugging this I've noticed that umbraco has a handy attribute to force camelCase at an API controller level if you need it.

    Adding : [JsonCamelCaseFormatter] to a controller class will force it to return camelCase while not affecting the wider solution.

  • Petra van Hees 4 posts 34 karma points
    Nov 14, 2018 @ 12:29
    Petra van Hees
    0

    Hi Kevin,

    Oh thanks, I was just starting to look at our controllers to see what I broke, this saves me some investigating :)

    Petra

Please Sign in or register to post replies

Write your reply to:

Draft