mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Fix/multilang (#326)
* Adding a few missing langs. * Remove unused extra language issue. * Fix secondary languages. Fixes #265
This commit is contained in:
parent
8cf1efbcb7
commit
98f88b8a26
1 changed files with 6 additions and 1 deletions
|
@ -392,7 +392,12 @@ export function getLanguage(override?: string): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBrowserLanguage(): string {
|
export function getBrowserLanguage(): string {
|
||||||
return navigator.language;
|
// Intersect lemmy's langs, with the browser langs
|
||||||
|
let langs = languages ? languages.map(l => l.code) : ["en"];
|
||||||
|
let allowedLangs = navigator.languages.filter(v => langs.includes(v)) || [
|
||||||
|
"en",
|
||||||
|
];
|
||||||
|
return allowedLangs[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMomentLanguage(): string {
|
export function getMomentLanguage(): string {
|
||||||
|
|
Loading…
Reference in a new issue