baifendian / bfd-ui

企业级 React 组件库 🚀
http://ui.baifendian.com
Other
238 stars 34 forks source link

国际化支持 #9

Closed jianghai closed 7 years ago

jianghai commented 8 years ago
const text = require('./lang/' + process.env.LANG)

webpack配置

config.plugins.push(new webpack.DefinePlugin({
    'process.env': {
      'LANG': JSON.stringify('en')
    }
  }))
jianghai commented 8 years ago

想了下,组件内部还是不集成国际化了,外部可以全局配置,以 Select placeholder 为例

import { Select } from 'bfd/Select'

Object.assign(Select.defaultProps, {
  placeholder: 'xxxx'
})