Open PaulEpitomy opened 5 years ago
We might need to update the layer filter to take the ILocalizable aspect into account if widgets have them. And if a Layer aggregates its widgets, we need to ensure that all version are stored there. Probably what you have done. Ideally without referencing the localization module. Just by resolving the culture of each widget using the aspect, and then ignoring the ones that are not for the ambient culture.
Another option might be to create custom layers for each widget. Could be much simpler and flexible.
I did think about custom layers but we have 7 layers at present and ~10 languages so this would result in 70 layers, so I'm not sure how practical that would be.
I can create a PR if it helps, could you elaborate on "And if a Layer aggregates its widgets, we need to ensure that all version are stored there", as I'm not sure I understand?
I present I'm only referencing the OrchardCore.ContentLocalization.Abstractions so think that's Ok?
That would work, please try to create a PR
Possible fix #4968 that may require additional work for GraphQL, should GraphQL filter widgets by culture or not?
I cannot find a way to localize widgets that are contained in layers, I've performed the following: -
At this point I just see multiple copies in the front end.
To get around this I have modified LayerService to de-dup based on the current culture
and in LayerFilter, changed the cache key to include the culture
Is there a better way to handle widget localization?