Created
July 17, 2013 08:30
-
-
Save hellraiser75/6018815 to your computer and use it in GitHub Desktop.
Change default language in cookie
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mySiteNamespace = {} | |
| mySiteNamespace.switchLanguage = function (lang) { | |
| $.cookie('language', lang); | |
| window.location.reload(); | |
| } | |
| $(document).ready(function () { | |
| // attach mySiteNamespace.switchLanguage to click events based on css classes | |
| $('.lang-english').click(function () { mySiteNamespace.switchLanguage('en'); }); | |
| $('.lang-french').click(function () { mySiteNamespace.switchLanguage('fr'); }); | |
| $('.lang-arabic').click(function () { mySiteNamespace.switchLanguage('ar'); }); | |
| $('.lang-spanish').click(function () { mySiteNamespace.switchLanguage('es'); }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment