Jump to Section
Introduction#
Regardless you are an editor or Umbraco developer you need to be careful during publishing changes in a multilingual Umbraco website.
I will try to explain and make you aware, so that you do not make such a mistake during publishing.
Scenario Explanation#
Let's imagine a multilingual website with a top menu managed through the Homepage Menu property which is based on the Multi URL Picker.
The homepage document type varies by culture, but the menu property remains the same across all languages.
Umbraco allows us to edit independent property regardless of the language we are working on.
Links in the Menu property are grayed out by default and a tooltip with a message is displayed as follows:
The menu is shared across all languages.
If we click on the edit button, we confirm that we understand the case, but please stay tuned.
Probably most of the editors and developers too are not aware of a specific corner case which I will try to explain.
First of all, if we save changes without publishing, we put the currently edited language variant into the Published with pending changes state.
We are putting into that state only the current language variant, not the whole node, regardless of whether we edited shared properties across all languages.
So, if we switch to a different language variant of the same node, we will not see pending changes at all.
In such a case, the homepage with pending changes will be visible only for the specific variant we selected for editing the Menu property.
Now, imagine a situation where you need to apply another changes in the other language variant of the same node.
So you will switch to the other language variant, apply the changes you need, and click Save & publish.
Unfortunately, your changes applied to the Menu properties will also be published.
Identifying the Issue#
Of course, editors understand that the Menu property is shared across all languages, but they are unaware that the previously applied changes are being published together with any other language variants.
Unfortunately, Umbraco is not indicating the pending changes status for other variants.
Everything would probably be fine if all language variants were in the pending changes state when an independent property changed.
However, it would probably be better to allow editing independent properties from the default language variant and publish such properties only together with this variant, which is required by design.
Workaround and Best Practices#
Editing Shared Properties
In my opinion, developers should avoid mixing independent properties with properties that vary by culture in a single document type, because it could be confusing and really painful for editors in a critical scenarios.
It would probably be better to set each property to vary by culture, but use the fallback while rendering content on the page.
Separate Configuration Nodes
In some cases, it would probably be better to move such properties to separate configuration nodes that don't vary by culture.
Conclusion#
By understanding and implementing these best practices, you can ensure a smoother and error-free publishing process on a multilingual Umbraco website.
Awareness and managing shared and independent properties are crucial to avoiding critical issues.
What's next?#
🌐 Explore More: Interested in learning about Umbraco, .NET, and other web development insights? Explore our blog for a wealth of information and expert advice.
✉️Get in Touch: If you have questions or need assistance with your Umbraco projects, don't hesitate to contact us. Our team of experts is always ready to help you navigate any challenges and optimize your digital solutions.