mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 04:25:10 +00:00
12 lines
386 B
TypeScript
12 lines
386 B
TypeScript
|
import React from "react";
|
||
|
|
||
|
const LangSwitch = () => {
|
||
|
const { hostname } = window.location
|
||
|
if (hostname === 'localhost') return null;
|
||
|
const en = window.location.href.replace(hostname, 'docs.nocobase.com')
|
||
|
const cn = window.location.href.replace(hostname, 'docs-cn.nocobase.com')
|
||
|
return <span><a href={en}>EN</a> | <a href={cn}>中文</a></span>
|
||
|
}
|
||
|
|
||
|
export default LangSwitch;
|