Is there a way to control the language prefix in a globalised site such that '/uk/' is displayed in the url instead of '/en-GB/'?
if so, any help or pointers would be greatly appreciated.
Go in to cms admin, click "Manage Website Languages" under the config tab. Then select your language and define a value for "Web address prefix".
Hi Linus and thank you for your response.
If I set a uk variant to have the web prefix of 'uk' in Admin mode, is there some way in code to access the web prefix via the framework API instead of url parsing?
This is depending on the place where you need to access the language code. If you have the language branch loaded you should of course get hold of this prefix. The language branch could be loaded from the PageData.LanguageBranch property.
If you have a link and want to determine the language branch it's a bit more trickier but if your code is running before the friendly URL-parser then you can look for the value of the epslanguage query string parameter. I would assume that this has the id of the language branch that you can use to load it and determine the URL segment for the language branch.
If the page has a fallback language how can we get the web address prefix for the preferred language?
I've found the ContentLanguage.PreferredCulture, but how do I go from there to the prefix?
I can answer my own question;