-
Notifications
You must be signed in to change notification settings - Fork 0
/
2779-19c10041aeb3f69113da.js
1 lines (1 loc) · 3.42 KB
/
2779-19c10041aeb3f69113da.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[2779],{52779:(n,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>k});var s=t(73450),e=t(27378),o=t(57318),p=t(24246);function c(n,a){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),t.push.apply(t,s)}return t}function r(n){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?c(Object(t),!0).forEach((function(a){(0,s.Z)(n,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))}))}return n}function l(n){return(0,p.jsx)(n.tag,r(r({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function u(n){return(0,p.jsx)(l,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function i(n){return(0,p.jsx)(l,{tag:"style",html:n.style})}function d(n,a){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(a+=n.offsetTop),d(n.parentNode,a);return a}class k extends e.Component{componentDidMount(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&(0,o.l)(document.documentElement,0,d(a,-9))}}render(){return e.createElement("div",{className:"zandoc-react-container"},e.createElement(i,{style:""}),e.createElement(u,{html:'<h2 class="anchor-heading"><a href="#guo-ji-hua">¶</a><a href="javascript:void(0)" id="guo-ji-hua" class="anchor-point"></a>国际化</h2>\n<p>目前 Zent 的默认语言为中文,同时提供英文支持。如需要在国际化场景下使用 Zent 组件,可以参考下面的方法。</p>\n<h4 class="anchor-heading"><a href="#i18nprovider">¶</a><a href="javascript:void(0)" id="i18nprovider" class="anchor-point"></a>I18nProvider</h4>\n<p>Zent 提供一个 Provider 组件用于配置组件内部文案的语言。组件利用 context 实现对组件内部文案的配置,需要在应用最外层包裹使用。</p>\n<pre><code class="language-jsx"><span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">I18nProvider</span><span class="token punctuation">,</span> enUSLocale <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">I18nProvider</span></span> <span class="token attr-name">value</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>enUSLocale<span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">App</span></span> <span class="token punctuation">/></span></span>\n<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">I18nProvider</span></span><span class="token punctuation">></span></span><span class="token punctuation">;</span></code></pre>\n<p>目前支持中文、英文以及日文三种语言包。</p>'}))}}}}]);