I have started using DNN6 and the localization facilities of DNN. My first effort was a 5-language site.
After installing the language packs, I hit the 'localise content' button and waited for the initialisation to take place.
The process stuck for two of the languages in the first page. This resulted to only one page displayed as localised in the localisation table. When trying to add a new page, localised in all languages I got the following error:
DotNetNuke.Services.Exceptions.ModuleLoadException: An item with the same key has already been added. ---> System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at DotNetNuke.Entities.Modules.ModuleInfo.get_LocalizedModules() at DotNetNuke.Entities.Modules.ModuleController.LocalizeModule(ModuleInfo sourceModule, Locale locale) at DotNetNuke.Entities.Tabs.TabController.CreateLocalizedCopy(TabInfo originalTab, Locale locale) at DotNetNuke.Entities.Tabs.TabController.CreateLocalizedCopies(TabInfo originalTab) at DotNetNuke.Modules.Admin.Tabs.ManageTabs.SaveTabData(String strAction) at DotNetNuke.Modules.Admin.Tabs.ManageTabs.cmdUpdate_Click(Object Sender, EventArgs e)
I thought the problem had to do with the localisation inisalisation going wrong but it wasn't.
It was actually a module that caused the problem. I had this module on a page with the 'show on all pages' setting checked. This somehow caused the module to be placed multiple times in the new pages.
After deleting the pages and trying to add a new one all over again the problem still existed.
Finally, I checked the database tables and saw that the module in table TabModules was linked with tab-ids that did not longer exist. I deleted these records and disabled the 'show on all pages' option. Adding a new page in all languages worked like a charm afterwards!
Quick summary:
Problem: Adding new page in multiple languages doesn't work due to Duplicate key error
Solution: Check if module with 'show on all pages' on exists and disable the option. Check the the TabModules table for module ids connected with tab ids that no longer exists. (in reference with the Tabs table)