Change Language Selector with jQuery

Posted by Community Admin on 04-Aug-2018 09:25

Change Language Selector with jQuery

All Replies

Posted by Community Admin on 19-Jul-2013 00:00

I want:         E | F | I

to be shown instead of:    English  française italian

I use this bit of jQuery to get pretty close.

The problem with this is that I get a  |  divider on the last Language Item as well.

Any of you jQuery experts can help me with that?

jQuery('.sflanguageLnk').each(function()
   var ShortText1 = jQuery(this).text().slice(0,1) + " | ";
  jQuery(this).text(ShortText1) ;
   )
  

Posted by Community Admin on 19-Jul-2013 00:00

Got it working.

Well as soon as one post the idea pops up :-)

var ShortText1 = jQuery(this).text().slice(0,1) + " | ";
jQuery(this).text(ShortText1) ;
)
jQuery('.sflanguagesHorizontalList li:last-child a').each(function()
var ShortText2 = jQuery(this).text().slice(0,-2);
jQuery(this).text(ShortText2) ;
)

It would be a nice feature if we could set the text and/or language to be displayed in the language selector under Admin - Setting - Languages along with the seperator.

Markus

This thread is closed