Function determineLanguage

  • Determines which language to show the game in.

    The function looks for langauge information from the following sources, from highest-to-lowest priority:

    1. The value of "lang" in the URL query string
    2. The value of the "lang" attribute in the HTML element (e.g. <html lang="fr">)

    If no valid language is found, will return the default language.

    Parameters

    • validLanguages: string[] = ...
    • defaultLanguage: string = "en"

    Returns string

Generated using TypeDoc