<div class="row">
    <div class="span9">
        <span id="long_description_text_1"></span>
    </div>
</div>
<div class="row">
    <div class="span9">
        <span id="long_description_text_2"></span>
    </div>
</div>

<script type="text/javascript" src="/static/js/pybossa/pybossa.js"></script>
<script type="text/javascript" src="/cellspotting/static/js/jquery.i18n.min.js"></script>
<script type="text/javascript" src="/cellspotting/static/js/cellspotting-internationalization.js"></script>

<script type="text/javascript">
    $("[rel=tooltip]").tooltip();
</script>

<script>
    
    var language;
    var dict;
    
    pybossa.setEndpoint("/pybossa");
    pybossa.getSettings().done(function(data){
        language = data.language;
        
        if (language == null) {
            // Detect browser language
            var userLang = navigator.language || navigator.userLanguage;
            
            if (userLang.indexOf("en") != -1)
                language = "en";
            else if (userLang.indexOf("es") != -1)
                language = "es";
            else if (userLang.indexOf("pt") != -1)
                language = "pt";
        }
        
        console.log("1"+language);
        
        switch(language){
            case "en": dict = en_US_dict; break;
            case "pt": dict = pt_dict;    break;
            case "es": dict = es_dict;    break;
            default:  dict = default_dict;
        }

        $.i18n.setDictionary(dict);    
    
        $('#long_description_text_1').html($.i18n._('long_description_text_1'));
        $('#long_description_text_2').html($.i18n._('long_description_text_2'));
    });
</script>

