mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 18:25:41 +03:00
Switch the common/native text
Prevents the lang selector from being jumpy
This commit is contained in:
parent
868e613089
commit
3048bd1eea
1 changed files with 3 additions and 3 deletions
|
@ -27,12 +27,12 @@ export default function LangSelector() {
|
|||
</>
|
||||
);
|
||||
}
|
||||
const common = localeCode2Text(lang);
|
||||
const native = localeCode2Text({ code: lang, locale: lang });
|
||||
const same = common === native;
|
||||
const common = localeCode2Text(lang);
|
||||
const showCommon = !!common && common !== native;
|
||||
return (
|
||||
<option value={lang} key={lang}>
|
||||
{same ? common : `${common} (${native})`}
|
||||
{showCommon ? `${native} (${common})` : native}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
|
|
Loading…
Reference in a new issue