Removing Multiple Language
Hi,
We are also facing the same issue which is indicated in www.sitefinity.com/.../removing-second-language.aspx.
We have Multiple languages website i.e. English, Czech, Russian & Chinese, where Czech if set as default. When we removed the two languages e.g. Russian and Chinese from Administration -> Settings -> Languages tool, the "Default" language i.e. Czech start showing page from Chinese and Russian. Meanwhile, the other language (English) website works fine and does not show different locale content.
The issue is only happening to Default Locale website. We confirmed this by setting 'English' as "Default" language, and the "English" website start showing content from other Locales.
We are using Sitefinity 4.2.1733.0
Let us know if the issue have been fixed.
Hi Nabeel,
Here is a short overview on how Sitefinity works. When you have monolingual site all the content is saved to the invariant culture. When another language is added, the default language reads from the invariant culture to display translations created in mono lingual, and from the default culture to display items created after adding a second language.
When you have more than one language in the system and you enter a translation for your default language then this translation is copied across to the translation for the invariant culture. If you enter a translation for your non default language and you don't have corresponding translation for the default language then this translation is copied across to the invariant culture too.
Whenever the default language is changed then the pages which do not have translations in this language fallback to the translations in the invariant culture.
To solve this problem you need to add missing translations for the new default language.
If you have any other questions please let me know.
Hello Nabeel,
I am sorry for my late reply. Here is the workaround that I can suggest: Loop through all the front end pages and un-publish those which are not available in Czech language. They should be unpublished in invariant culture too.
PageManager manager =
new
PageManager();
var pages = manager.GetPageNodes().Where(p => p.RootNodeId == SiteInitializer.FrontendRootNodeId);
var defaultCulture =
new
CultureInfo(
"cs"
);
foreach
(PageNode node
in
pages)
if
(node.Page.Title.GetStringNoFallback(defaultCulture) ==
null
)
manager.UnpublishPage(node.Page, defaultCulture);
manager.UnpublishPage(node.Page, CultureInfo.InstalledUICulture);
manager.SaveChanges();
Please understand that switch of default culture is not a supported scenario and manipulating the pages through scripts is risky. Please backup you database before you execute the script.
If you have other questions, please let me know.