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:
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 ?
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.
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.
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.
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
Hi Petra,
are there any errors in the Chrome developer console ?
Alongside the all to
GetContentInfo
, there should be a call toGetInstalledCultures
(/umbraco/backoffice/TranslationManager/TranslationSetApi/GetInstalledCultures)This gets the languages for the dropdown, could you check and see if that returning anything ?
Kevin
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
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):
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.
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
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.Hi Kevin,
Oh thanks, I was just starting to look at our controllers to see what I broke, this saves me some investigating :)
Petra
is working on a reply...