jQuery call function when language in selectbox is changed
===

I have the following problem.
To translate a website, I'm using the [jQuery Localize][1] plugin.
This works fine. However, I want a CSS styled selectbox with flags and languages, and when a different option is selected the call to `$("[data-localize]").localize("schiphol", { language: $(this).attr('value')` should be made to translate the page.

This code I'm currenly using, and it works fine for a plain, not-styled selectbox.

    <script type="text/javascript">
    $(function() {
    					
    $('#polyglot-language-options').change(function() 
    {
    	if ($(this).attr('value') == "en") {
    		$("[data-localize]").localize("example", { language: $(this).attr('value') });
    	}
    	else if ($(this).attr('value') == "nl") {
    		location.reload();
    	}
    });
    
    });
    </script>

But I want to style it, so I tried to integrate the ["polyglot" language switcher][2]. However, the current code doesn't work.

How can I integrate the $("[data.localize]").localize(); function in this code:
  

      $('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({
    				effect:'fade',
    				testMode:true
    			});



  [1]: https://github.com/coderifous/jquery-localize/
  [2]: http://www.ixtendo.com/polyglot-language-switcher-jquery-plugin/