November Happy Hour will be moved to Thursday December 5th.

ViewConfiguration Name is no longer translated

Vote:
 

Hi!

I have upgraded our plugin to CMS 12 and the followinmg added menu option does no longer get translated it is alway the same language no matter what UI language I select.

[ServiceConfiguration(typeof(ViewConfiguration))]
public class SendToTranslationView : ViewConfiguration<IContentData>
{
    public SendToTranslationView()
    {
        var localization = ServiceLocator.Current.GetInstance<LocalizationService>();
        var currentCulture = Thread.CurrentThread.CurrentUICulture;
        Key = "SendToTranslationView";
        Name = localization.GetString("/Translations/ContentView/Heading");
        Description = localization.GetString("/Translations/ContentView/Description");
        ControllerType = "epi-cms/widget/IFrameController";
        ViewType = "/MyPlugin/ContentTranslationHistory/Index";
        IconClass = "epi-iconCatalog epi-icon--medium";
    }
}

On startup currentCulture is sv-SE but after login the above code is run again and then with en as currentCulture.

It worked just fine in CMS 11, has the ViewConfiguration changed in CMS 12?

Thanks!

/Kristoffer

#269199
Edited, Dec 30, 2021 12:04
Vote:
 

Looks like posting forum threads is the way to solve problems.

Name and Description no longer work but LanguagePath does, so this is the solution:

[ServiceConfiguration(typeof(ViewConfiguration))]
public class SendToTranslationView : ViewConfiguration<IContentData>
{
    public SendToTranslationView()
    {
        Key = "SendToTranslationView";
        ControllerType = "epi-cms/widget/IFrameController";
        ViewType = "/MyPlugin/ContentTranslationHistory/Index"; 
        IconClass = "epi-iconCatalog epi-icon--medium";
        LanguagePath = "/Translations/ContentView";
    }
}

/Kristoffer

#269200
Dec 30, 2021 12:21
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.