Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-29 20:36:07 +02:00
parent a2f959334b
commit c56b5a11da
16 changed files with 23 additions and 22 deletions

View File

@ -7,11 +7,11 @@ lastUpdated: 2020-10-06T18:47:16+03:00
Detects the preferred language of the current user.
- Use `NavigationLanguage.language` or the first `NavigationLanguage.languages` if available, otherwise return `defaultLang`.
- Use `Navigator.language` or the first value of `Navigator.languages` if available, otherwise return `defaultLang`.
- Omit the second argument, `defaultLang`, to use `'en-US'` as the default language code.
```js
const detectLanguage = (defaultLang = 'en-US') =>
const detectLanguage = (defaultLang = 'en-US') =>
navigator.language ||
(Array.isArray(navigator.languages) && navigator.languages[0]) ||
defaultLang;