Read JSON with jQuery
<p>I want to load a JSON file and read the following data</p>

<pre><code>{
    "extTitle": {
        "message": "test1"
    },
    "extName":{
        "message": "test2"
    }
}
</code></pre>

<p>This is how I load the data</p>

<pre><code>function loadLocales(){
    var userLang = (navigator.language) ? 
                    navigator.language : navigator.userLanguage;

    switch(userLang){
        default:
            $.getJSON("_locales/ne/messages.json", function(data){
                return data;
            });
        break;
    }
}
</code></pre>

<p>When I try to read with the following function I get an </p>

<pre><code>i18n undefined error
</code></pre>

<p>.</p>

<pre><code>function getValue(key){
    var i18n = loadLocales();
    return i18n[key].message;
}
</code></pre>

<p>Any ideas?</p>
