1

Resolved

Adding localization part to widgets make them not to show in front-end.

description

When adding a localization part to a widget, the widget of the master language is not being displayed.

I foound in WidgetFilter.cs the following line blocking the widgets with the language of the site:
// ignore widget for different cultures
                var localizablePart = widgetPart.As<ILocalizableAspect>();
                if (localizablePart != null  && localizablePart.Culture != workContext.CurrentCulture) {
                    continue;
                }
I added an extra condition (localizablePart.Culture!=null) to the "if sentence" and it works in my project.
// ignore widget for different cultures
                var localizablePart = widgetPart.As<ILocalizableAspect>();
                if (localizablePart != null  && localizablePart.Culture != workContext.CurrentCulture && localizablePart.Culture!=null) {
                    continue;
                }
Please include it in next release.

comments

x0r wrote Dec 18, 2013 at 8:00 PM

This sounds familiar. The LocalizationPart sometimes saves the default culture as NULL (instead of the actual Id value).

jusquiano wrote Dec 18, 2013 at 9:07 PM

The concern is about using widgets in localized sites. If you add the localization part to a widget, it will not be rendered. In the other hand the translation of the widget will be rendered. I found the solution that fits in both scenarios, and that's what i am posting here.

sebastienros wrote Sep 12 at 12:50 AM

The code already reflects the change you are mentioning, so this should be fine already.

jusquiano wrote Sep 12 at 4:40 PM

Awesome, thx!!