I’m using sitecore 6.5 with two languages installed, en (default) and fr-CA. There are items in the tree with content in both en and fr-CA.
The problem is that the French url has ‘fr-CA’ in it and we want that to be ‘fr’, for example:
http://website.com/fr/page.aspx instead of http://website.com/fr-CA/page.aspx
I tried renaming the language from ‘fr-CA’ to ‘fr’ and that fixed the url but the content still points to the old language ‘fr-CA’, so the item shows three languages: en, fr and fr-CA. It’s not recognizing the name change.
Any suggestions are much appreciated.
Thanks,
Tarek
The problem is you have created
fr-CAversions of your items which cannot be fixed by renaming the language .. you can now make afrversion but, like you are seeing, this means there are now 3 possible versions.One suggestion is to leave the languages in Sitecore alone and alter how links are served and processed instead.
You would probably need to look at adding your own method into the
httpRequestBeginpipeline in Sitecore. This would follow theLanguageResolverentry. You can then parse theRawUrland setSitecore.Context.Langauge' to French if the first element in it matched/fr/`.Extremely quick & dirty example:
You would probably also have to override the
LinkProviderin the<linkManager>section of the web.config to format your URLs when they are resolved by Sitecore.Another extremely quick & dirty example:
Another way (slightly more long-winded as it will need to be executed via a script) is to copy the data from the
fr-CAversion to thefrversion and then delete the fr-CA version of each item.Rough helper method that encompasses what you’re trying to do
Another way to update the languages on your content items is:
.xmlfile (Using the Control Panel)Also you can create a sql script that will change fr-CA language with the fr for all records in the UnversionedFields and VersionedFields tables.
If you need any more information or examples please let me know. 🙂