Working with multiple language sites in Sitecore 6.2 I would like Sitecore to replace the "" (white space, traditionally replaced with% 20) in the URLs with a hyphen.
eg. www.MySite.com/Hello World> www.MySite.com/Hello-World
There is still no problem, we just add another entry to encodeNameReplacements
<replace mode="on" find=" " replaceWith="-" />
Then, so that our content authors do not create hyphenated elements in their names (which Sitecore would understand as free space when reading its URLs, resulting in 404 Not Found), we can add a hyphen to the list of prohibited characters in element names using
<setting name="InvalidItemNameChars" value="\/:?"<>|[]-"/>
All this works great - until I try to create a new definition of the language. Languages in Sitecore can use a simple language code (for example, en, da, de, etc.) or a language and region (ISO) code such as en-GB, da-DK, de-DE, etc. For our sites, we will need regional codes, as we intend to support regional language variations (for example, Swiss French and Swiss German). But, of course, now I have forbidden a hyphen in element names (and languages, like everything else in Sitecore, are defined as elements). In fact, Sitecore requires the language name to be correctly constructed as a culture identifier, so I can not assign the language a descriptive name (for example, American English) with the iSO code specified in the ISO code field of the template.
Can anyone suggest a suitable solution? Should I remove the hyphen from the InvalidItemNameChars node and write my own piece of code that the traps tried to create the names of the portable names i? If so, how should I interecpt the creation event?
I don’t like to configure the interface where it’s not needed, especially since I can worry that this may create problems for updating the version of Sitecore, so if there are other solutions, I would like to hear them.
Thanks in advance.