import osLocale from 'os-locale' ; import * as zhCN from './zh-CN' ; import * as enUS from './en-US' ; const languages = { 'zh-CN' : zhCN , 'en-US' : enUS , } ; const locale = osLocale . sync ( ) || 'en-US' ; export default function i18n ( key ) { return languages [ locale ] [ key ] || enUS [ key ] || key ; }