Loads the provided {@code lang} into prism.

@param {String} lang
Code of the language to load.
@return {Object} The Prism language object for the provided {@code lang} code. {@code undefined} if the language is not known to Prism.
962754
function loadPrismLang(lang) {
    if (!lang) return undefined;
    let langObject = Prism.languages[lang];
    if (langObject === undefined) {
        try {
            require('prismjs/components/prism-' + lang);
            return Prism.languages[lang];
        } catch (e) {
            // nothing to do
        }
    }
    return langObject;
}
229106
function translate(content, langFile) {
  return content.replace(templateRegEx, function (match, capture) {
    return (0, _lodash2.default)(langMap.get(langFile), capture);
  });
}
975371
public static function load(array $langs, $lang = null)
    {
        static::$langs = $langs;
        static::$lang = $lang ?: key($langs);
    }
993215
function (lang, success, error) {
		var load = function () {
			var force = false;
			// Do we want to force reload the grammar?
			if (lang.indexOf('!') >= 0) {
				force = true;
				lang = lang.replace('!', '');
			}

			var data = lang_data[lang];
			if (!data) {
				data = lang_data[lang] = {};
			}
			if (success) {
				if (!data.success_callbacks) {
					data.success_callbacks = [];
				}
				data.success_callbacks.push(success);
			}
			if (error) {
				if (!data.error_callbacks) {
					data.error_callbacks = [];
				}
				data.error_callbacks.push(error);
			}

			if (!force && Prism.languages[lang]) {
				languageSuccess(lang);
			} else if (!force && data.error) {
				languageError(lang);
			} else if (force || !data.loading) {
				data.loading = true;
				var src = getLanguagePath(lang);
				script(src, function () {
					data.loading = false;
					languageSuccess(lang);

				}, function () {
					data.loading = false;
					data.error = true;
					languageError(lang);
				});
			}
		};
		var dependencies = lang_dependencies[lang];
		if(dependencies && dependencies.length) {
			loadLanguages(dependencies, load);
		} else {
			load();
		}
	}
113233
function downloadLanguage (language, callback)
	{
		grunt.log.writeln ('Fetching ' + language.url);
		getJSON (getHttpParameters (language.token), function (data) {
			grunt.file.write (options.dest + '/' + language.token + '.json', JSON.stringify (data));
			callback ();
		});
	}
654858
function(project) {
        return request.read(project.lang_catalog)
            .then(function(response) {
                // consume language data
                if(response.status !== 200) return Promise.reject(response);

                let data;
                try {
                    data = JSON.parse(response.data);
                } catch(err) {
                    return Promise.reject(err);
                }

                let projects = [];
                for(let language of data) {
                    try {
                        let language_id = library.addSourceLanguage({
                            slug: language.language.slug,
                            name: language.language.name,
                            direction: language.language.direction
                        });

                        project.categories = _.map(project.meta, function (names, slug, index) {
                            return {name: names[index], slug: slug};
                        }.bind(this, language.project.meta));

                        if (project.slug.toLowerCase() !== 'obs') {
                            project.chunks_url = 'https://api.unfoldingword.org/bible/txt/1/' + project.slug + '/chunks.json';
                        }

                        let projectId = library.addProject({
                            slug: project.slug,
                            name: language.project.name,
                            desc: language.project.desc,
                            icon: project.icon,
                            sort: project.sort,
                            chunks_url: project.chunks_url,
                            categories: project.categories,
                        }, language_id);

                        projects.push({
                            id: projectId,
                            chunks_url: project.chunks_url,
                            slug: project.slug,
                            resourceUrl: language.res_catalog,
                            source_language_slug: language.language.slug,
                            source_language_id: language_id
                        });
                    } catch (err) {
                        return Promise.reject(err);
                    }
                }

                // TRICKY: we just flipped the data hierarchy from project->lang to lang->project for future compatibility
                return projects;
            });
    }
961335
def get_lang_class(lang):
    
    global LANGUAGES
    # Check if an entry point is exposed for the language code
    entry_point = get_entry_point("spacy_languages", lang)
    if entry_point is not None:
        LANGUAGES[lang] = entry_point
        return entry_point
    if lang not in LANGUAGES:
        try:
            module = importlib.import_module(".lang.%s" % lang, "spacy")
        except ImportError as err:
            raise ImportError(Errors.E048.format(lang=lang, err=err))
        LANGUAGES[lang] = getattr(module, module.__all__[0])
    return LANGUAGES[lang]
535972
function fetchLanguage ( url, language ) {
	const part = url.split('/'); part.pop();
	return got(normalizeUrl(`${API_URL}/${path.join(part.join('/'))}/${language}`));
}
907062
def lang(self, lang):
        
        self.graph.set((self.asNode(), DC.language, Literal(lang)))
1343591
def init_language_data(self, lang, lang_data_type):
        
        if lang not in self.loaded_langs:
            self.loaded_langs[lang] = {}

        if lang_data_type not in self.loaded_langs[lang]:
            result = self._query_lang(lang=lang, lang_data_type=lang_data_type)
            data = self._process_lang(result)
            self.loaded_langs[lang].update({lang_data_type: data})
1015679
function getLanguageCode(langCode) {
        if (!languageCodes[langCode]) {
            languageCodes[langCode] = langCode.split(/\-|_/).shift();
        }
        return languageCodes[langCode];
    }
103511
public static String resolve( String lang ) {

		String result;
		if( ! LANGUAGES.contains( lang ))
			result = EN;
		else
			result = lang;

		return result;
	}
752137
function (lang) {
		if (lang_data[lang] && lang_data[lang].error_callbacks && lang_data[lang].error_callbacks.length) {
			lang_data[lang].error_callbacks.forEach(function (f) {
				f(lang);
			});
		}
	}
545546
function compileLanguage(language) {
  compileMode(language)

  // Compile a language mode, optionally with a parent.
  function compileMode(mode, parent) {
    var compiledKeywords = {}
    var terminators

    if (mode.compiled) {
      return
    }

    mode.compiled = true

    mode.keywords = mode.keywords || mode.beginKeywords

    if (mode.keywords) {
      if (typeof mode.keywords === 'string') {
        flatten('keyword', mode.keywords)
      } else {
        Object.keys(mode.keywords).forEach(function(className) {
          flatten(className, mode.keywords[className])
        })
      }

      mode.keywords = compiledKeywords
    }

    mode.lexemesRe = langRe(mode.lexemes || /\w+/, true)

    if (parent) {
      if (mode.beginKeywords) {
        mode.begin =
          '\\b(' + mode.beginKeywords.split(space).join(verticalBar) + ')\\b'
      }

      if (!mode.begin) {
        mode.begin = /\B|\b/
      }

      mode.beginRe = langRe(mode.begin)

      if (!mode.end && !mode.endsWithParent) {
        mode.end = /\B|\b/
      }

      if (mode.end) {
        mode.endRe = langRe(mode.end)
      }

      mode.terminatorEnd = source(mode.end) || ''

      if (mode.endsWithParent && parent.terminatorEnd) {
        mode.terminatorEnd +=
          (mode.end ? verticalBar : '') + parent.terminatorEnd
      }
    }

    if (mode.illegal) {
      mode.illegalRe = langRe(mode.illegal)
    }

    if (mode.relevance === undefined) {
      mode.relevance = 1
    }

    if (!mode.contains) {
      mode.contains = []
    }

    mode.contains = concat.apply(
      [],
      mode.contains.map(function(c) {
        return expandMode(c === 'self' ? mode : c)
      })
    )

    mode.contains.forEach(function(c) {
      compileMode(c, mode)
    })

    if (mode.starts) {
      compileMode(mode.starts, parent)
    }

    terminators = mode.contains
      .map(map)
      .concat([mode.terminatorEnd, mode.illegal])
      .map(source)
      .filter(Boolean)

    mode.terminators =
      terminators.length === 0
        ? {exec: execNoop}
        : langRe(terminators.join(verticalBar), true)

    function map(c) {
      return c.beginKeywords ? '\\.?(' + c.begin + ')\\.?' : c.begin
    }

    // Flatten a classname.
    function flatten(className, value) {
      var pairs
      var pair
      var index
      var length

      if (language[keyInsensitive]) {
        value = value.toLowerCase()
      }

      pairs = value.split(space)
      length = pairs.length
      index = -1

      while (++index < length) {
        pair = pairs[index].split(verticalBar)

        compiledKeywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1]
      }
    }
  }

  // Create a regex for `value`.
  function langRe(value, global) {
    return new RegExp(
      source(value),
      'm' + (language[keyInsensitive] ? 'i' : '') + (global ? 'g' : '')
    )
  }

  // Get the source of an expression or string.
  function source(re) {
    return (re && re.source) || re
  }
}
364492
function(o, callback) {
      for (var i in o) {
        callback.call(o, i, o[i]);

        if (Prism.util.type(o) === 'Object') {
          Prism.languages.DFS(o[i], callback);
        }
      }
    }
336955
public Map<String, String> getDefaultLanguage(String appid) {
		if (!LANG_CACHE.containsKey(getDefaultLanguageCode())) {
			logger.info("Default language map not set, loading English.");
			Map<String, String> deflang = readLanguageFromFile(appid, getDefaultLanguageCode());
			if (deflang != null && !deflang.isEmpty()) {
				LANG_CACHE.put(getDefaultLanguageCode(), deflang);
				return Collections.unmodifiableMap(deflang);
			}
		}
		return Collections.unmodifiableMap(LANG_CACHE.get(getDefaultLanguageCode()));
	}
727588
public Locale getLocaleOrDefault(String language) {
        String lang = getLanguageOrDefault(language);
        return Locale.forLanguageTag(lang);
    }