I have a file called LocaleConverter:

var LocaleConverter = (function() {

    return {
        convertLocale: function(localeToConvert) {
            switch (localeToConvert) {
                case 'en-US':
                    return 'en-US';
                case 'en-GB':
                    return 'en-GB';
                case 'es':
                case 'es-MX':
                    return 'es';
                case 'fr-FR':
                    return 'fr';
                case 'fr-CH':
                    return 'fr-CH';
                    return 'en-US';

} ());

I am bringing in the script into my master page like:

<script src="../../Scripts/LocaleConverter.js" type="text/javascript"></script>

But when I try something like:

var convertedLocale = LocaleConverter.convertLocale("fr-FR");

It gives me an error telling me that convertedLocale does not exist when I try to use it elsewhere?

Related posts

Recent Viewed