react-polyglot:React组件和挂钩以使用Polyglot-源码

上传者: 42122878 | 上传时间: 2021-05-12 10:03:05 | 文件大小: 109KB | 文件类型: ZIP
React多语种 提供更高阶的组件以将Polyglot与React结合使用 安装 npm install --save react-polyglot 用法 react-polyglot导出包含一个名为I18n包装器组件,一个名为translate装饰器和一个名为useTranslate钩子。 装饰器提供了一种丙t这是实例Polyglot 。 您需要用I18n包装您的根组件,并传递en或fr类的locale 。 和包含字符串的messages对象。 import React from 'react' ; import { render } from 'react-dom' ; import { I18n } from 'react-polyglot' ; import App from './components/app' ; const locale = window . locale

文件下载

资源详情

[{"title":"( 27 个子文件 109KB ) react-polyglot:React组件和挂钩以使用Polyglot-源码","children":[{"title":"react-polyglot-develop","children":[{"title":".gitignore <span style='color:#111;'> 645B </span>","children":null,"spread":false},{"title":".babelrc <span style='color:#111;'> 62B </span>","children":null,"spread":false},{"title":".codesandbox","children":[{"title":"ci.json <span style='color:#111;'> 33B </span>","children":null,"spread":false}],"spread":true},{"title":".eslintrc <span style='color:#111;'> 549B </span>","children":null,"spread":false},{"title":"package.json <span style='color:#111;'> 1.82KB </span>","children":null,"spread":false},{"title":"src","children":[{"title":"useTranslate.d.ts <span style='color:#111;'> 239B </span>","children":null,"spread":false},{"title":"index.js <span style='color:#111;'> 146B </span>","children":null,"spread":false},{"title":"translate.d.ts <span style='color:#111;'> 669B </span>","children":null,"spread":false},{"title":"translate.js <span style='color:#111;'> 472B </span>","children":null,"spread":false},{"title":"i18n.test.js <span style='color:#111;'> 1.42KB </span>","children":null,"spread":false},{"title":"useTranslate.js <span style='color:#111;'> 153B </span>","children":null,"spread":false},{"title":"i18n-context.js <span style='color:#111;'> 97B </span>","children":null,"spread":false},{"title":"i18n.js <span style='color:#111;'> 1.34KB </span>","children":null,"spread":false},{"title":"i18n.d.ts <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false},{"title":"index.d.ts <span style='color:#111;'> 180B </span>","children":null,"spread":false}],"spread":true},{"title":"webpack.config.js <span style='color:#111;'> 382B </span>","children":null,"spread":false},{"title":"SECURITY.md <span style='color:#111;'> 619B </span>","children":null,"spread":false},{"title":".travis.yml <span style='color:#111;'> 482B </span>","children":null,"spread":false},{"title":"CONTRIBUTING.md <span style='color:#111;'> 841B </span>","children":null,"spread":false},{"title":"LICENSE <span style='color:#111;'> 1.06KB </span>","children":null,"spread":false},{"title":".prettierignore <span style='color:#111;'> 27B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 3.61KB </span>","children":null,"spread":false},{"title":"example","children":[{"title":"app.js <span style='color:#111;'> 413B </span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'> 154B </span>","children":null,"spread":false},{"title":"greeter.js <span style='color:#111;'> 179B </span>","children":null,"spread":false}],"spread":false},{"title":".prettierrc <span style='color:#111;'> 69B </span>","children":null,"spread":false},{"title":"yarn.lock <span style='color:#111;'> 254.07KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明