Can you change Language Link Text?

Posted by Community Admin on 04-Aug-2018 20:11

Can you change Language Link Text?

All Replies

Posted by Community Admin on 29-Aug-2013 00:00

When setting up your site for multiple languages, is there a way to control the text that dynamically appears? (for users to switch between languages)

Example:
In addition to the already existing English version of our site, we are migrating from French (fr), to French Canadian (fr-CA). The resulting Language link that appears in the header of our Templated site is presented as "français (Canada)". We don't want "Canada" to appear, so is there a way in Sitefinity to change this?

I've already looked in Admin > System > Inteface Labels & Messages. It's definitely not an option in there. I can do this with jQuery, but I prefer not to.

Thanks in advance for any help,
R

Posted by Community Admin on 30-Aug-2013 00:00

Hi R,

In order to achieve this you could create your own version of the LanguageSelectorControl widget. In this case you could have influence on the rendering of the items inside the dropdown. (or the horizontal/vertical presentations)

Not sure if you are familiar with this, you could take a look at this code:

public class LanguagePicker : LanguageSelectorControl
 
   // Override e.g. the BindLanguageContainers or the GetDisplayedLanguageName methods

It inherits from the LanguageSelectorControl. You could override the GetDisplayedLanguageName and return a static value if the language is fr-CA.

If you have any questions, let me know.

Kind regards,
Daniel

Posted by Community Admin on 30-Aug-2013 00:00

For a simple page I went the jquery way

www.sitefinity.com/.../change-language-selector-with-jquery

You could find your (Canadian) and shorten it. But I guess Daniels solution would be cleaner

Markus

PS: I posted the idea many time that we could set text, image, deliminator in the Admin - Language setting next to each language to be used. Like this we would be super flexible.

This thread is closed