mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-27 11:08:30 +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
|
@ -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