Skip to content

five-on-it / apps/client/src/ui/i18n / startLanguage

Function: startLanguage() ​

startLanguage(stored, wanted): "en" | "de" | "it" | "fr" | "es"

Defined in: apps/client/src/ui/i18n.ts:36

The language to start in: the one the player picked before (stored) when the game has it, else the first of the browser's languages (wanted, as navigator.languages gives them: de-CH, fr) whose own language the game has, else English.

Parameters ​

stored ​

string | null | undefined

wanted ​

readonly string[]

Returns ​

"en" | "de" | "it" | "fr" | "es"