React Translate 组件 Translate 是 React 的一个组件,它利用 Counterpart 模块和 Interpolate 组件来提供多语言/本地化文本内容。
它允许在不重新加载页面的情况下切换语言环境。
安装 通过 npm 安装: % npm install react-translate-component 用法 这是一个快速入门教程,可帮助您启动和运行 Translate。
这是关于如何从头开始构建使用 Translate 组件的简单应用程序的分步指南。
我们假设您安装了最新版本的 Node.js 和 npm。
首先,让我们创建一个新项目: $ mkdir translate-example $ cd translate-example $ touch client.js $ npm init # 在这里接受所有默认值 接下来,添加我们的小项目需要的依赖项: $ npm install react 对应物 react-interpolate-组件 react-translate-component --save react、counter 和 react
评论0
最新资源