            return lang;
        }

        function capitalizeFirstLetter(string) {
            return string.charAt(0).toUpperCase() + string.slice(1);
        }

        function processSampleEl(sampleEl, prefLangId) {
            var codeEl = sampleEl.querySelector("code[data-lang]");
            if (codeEl != null) {
                sampleEl.setAttribute("data-lang", codeEl.getAttribute("data-lang"));
                if (codeEl.getAttribute("data-lang") !== prefLangId) {
                    sampleEl.cl