|
|
|
@ -142,11 +142,27 @@ class LaptopNavbar extends Component { |
|
|
|
|
</Menu> |
|
|
|
|
<select |
|
|
|
|
className="language-select" |
|
|
|
|
onChange={(e) => changeLanguage(e.target.value)} |
|
|
|
|
defaultValue={localStorage.getItem("language") || "fa"} |
|
|
|
|
onChange={(e) => { |
|
|
|
|
window.localStorage.setItem("language", e.target.value); |
|
|
|
|
window.location.reload(); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{console.log(window.lang)} |
|
|
|
|
|
|
|
|
|
{[ |
|
|
|
|
{ key: "فارسی", lang: "fa", default: true }, |
|
|
|
|
{ key: "English", lang: "en" }, |
|
|
|
|
{ key: "العربیه", lang: "ar" }, |
|
|
|
|
].map((el, index) => ( |
|
|
|
|
<option |
|
|
|
|
key={el.lang} |
|
|
|
|
value={el.lang} |
|
|
|
|
selected={ |
|
|
|
|
(!window.lang && el.default) || el.lang == window.lang |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
|
<option key={index}>{lang}</option> |
|
|
|
|
{el.key} |
|
|
|
|
</option> |
|
|
|
|
))} |
|
|
|
|
</select> |
|
|
|
|
<div |
|
|
|
@ -179,11 +195,27 @@ class LaptopNavbar extends Component { |
|
|
|
|
<div className="d-flex"> |
|
|
|
|
<select |
|
|
|
|
className="language-select" |
|
|
|
|
onChange={(e) => changeLanguage(e.target.value)} |
|
|
|
|
defaultValue={localStorage.getItem("language") || "fa"} |
|
|
|
|
onChange={(e) => { |
|
|
|
|
window.localStorage.setItem("language", e.target.value); |
|
|
|
|
window.location.reload(); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{console.log(window.lang)} |
|
|
|
|
|
|
|
|
|
{[ |
|
|
|
|
{ key: "فارسی", lang: "fa", default: true }, |
|
|
|
|
{ key: "English", lang: "en" }, |
|
|
|
|
{ key: "العربیه", lang: "ar" }, |
|
|
|
|
].map((el, index) => ( |
|
|
|
|
<option |
|
|
|
|
key={el.lang} |
|
|
|
|
value={el.lang} |
|
|
|
|
selected={ |
|
|
|
|
(!window.lang && el.default) || el.lang == window.lang |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
{["fa", "en", "ar"].map((lang, index) => ( |
|
|
|
|
<option key={index}>{lang}</option> |
|
|
|
|
{el.key} |
|
|
|
|
</option> |
|
|
|
|
))} |
|
|
|
|
</select> |
|
|
|
|
<Link |
|
|
|
|