Skip to content

Commit

Permalink
docs: adjust some content
Browse files Browse the repository at this point in the history
1. fix example code error
2. adjust some English translation
  • Loading branch information
eyelly-wu committed Sep 25, 2023
1 parent 9b1d245 commit 20a8afc
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Mainly composed of `2` parts

**I18nProvider**:Configure container components for internationalization initialization properties

**useI18n**:Hook method for obtaining internationalization API and status
**useI18n**:Hook method for obtaining internationalization API and state



Expand Down
6 changes: 3 additions & 3 deletions docs/dist/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Configure container components for internationalization initialization propertie
<h3 id="i18nprovider-type">Type</h3>
<pre>
(
props: <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#i18nstate">i18nState</a> & { children: React.ReactNode },
props: <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#i18nstate">I18nState</a> & { children: React.ReactNode },
) => JSX.Element
</pre>

<h3 id="i18nprovider-parameter-description">Parameter Description</h3>
The other attributes are consistent with the <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#initi18n">initI18n</a> parameter<table>
The other parameters are consistent with the <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API.md#initi18n">initI18n</a> parameters<table>
<tr>
<th>Parameter name</th>
<th>Description</th>
Expand All @@ -37,7 +37,7 @@ The other attributes are consistent with the <a href="https://github.com/i18n-p
</table>

## useI18n
Hook method for obtaining internationalization API and status
Hook method for obtaining internationalization API and state
<h3 id="usei18n-type">Type</h3>
<pre>
() => ({
Expand Down
4 changes: 2 additions & 2 deletions docs/dist/API_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
<h3 id="i18nprovider-类型">类型</h3>
<pre>
(
props: <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#i18nstate">i18nState</a> & { children: React.ReactNode },
props: <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#i18nstate">I18nState</a> & { children: React.ReactNode },
) => JSX.Element
</pre>

<h3 id="i18nprovider-参数说明">参数说明</h3>
其他属性与 <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#initi18n">initI18n</a> 参数一致<table>
其他参数与 <a href="https://github.com/i18n-pro/core/blob/v2.0.0/docs/dist/API_zh-CN.md#initi18n">initI18n</a> 参数一致<table>
<tr>
<th>参数名</th>
<th>说明</th>
Expand Down
4 changes: 2 additions & 2 deletions docs/dist/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
// App.tsx
import React from 'react'
import { render } from 'react-dom'
import { useI18n } from '@i18n-pro/react'
import { I18nProvider, useI18n } from '@i18n-pro/react'
import i18nState from './i18n.ts'

function App() {
Expand Down Expand Up @@ -142,7 +142,7 @@ export default function SwitchLang() {
// App.tsx
import React from 'react'
import { render } from 'react-dom'
import { useI18n } from '@i18n-pro/react'
import { I18nProvider, useI18n } from '@i18n-pro/react'
import i18nState from './i18n.ts'
+ import SwitchLang from './SwitchLang'

Expand Down
4 changes: 2 additions & 2 deletions docs/dist/USAGE_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
// App.tsx
import React from 'react'
import { render } from 'react-dom'
import { useI18n } from '@i18n-pro/react'
import { I18nProvider, useI18n } from '@i18n-pro/react'
import i18nState from './i18n.ts'

function App() {
Expand Down Expand Up @@ -142,7 +142,7 @@ export default function SwitchLang() {
// App.tsx
import React from 'react'
import { render } from 'react-dom'
import { useI18n } from '@i18n-pro/react'
import { I18nProvider, useI18n } from '@i18n-pro/react'
import i18nState from './i18n.ts'
+ import SwitchLang from './SwitchLang'

Expand Down
4 changes: 2 additions & 2 deletions docs/src/api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ function I18nProvider(props: I18nProProps) {
type={`(
props: ${getTitleToA(
i18nProPkg,
'i18nState',
'I18nState',
)} & { children: React.ReactNode },
) => JSX.Element`}
propsDesc={
<>
{t(
'其他属性与{0}参数一致',
'其他参数与{0}参数一致',
` ${render(
<a href={getI18nProDocHref(i18nProPkg, 'API', 'initI18n')}>
initI18n
Expand Down
4 changes: 2 additions & 2 deletions docs/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"简易示例如下": "A simple example is as follows",
"hello world": "Hello world",
"适用于 React 的轻量、简单、灵活、自动翻译的国际化工具": "Lightweight, simple, flexible, automatic translation internationalization tool for React",
"获取国际化 API 和状态的 hook 方法": "Hook method for obtaining internationalization API and status",
"获取国际化 API 和状态的 hook 方法": "Hook method for obtaining internationalization API and state",
"主要由{0}部分构成": "Mainly composed of {0} parts",
"变量插值": "Variable Interpolation",
"插值变量": "Interpolation Variable",
Expand All @@ -44,7 +44,7 @@
"参数说明": "Parameter Description",
"返回值": "Return Value",
"至此,项目已经完全接入了国际化,上面{0}指定为目标语言中任意一个,在页面上就能看到翻译好的内容了。后续如果项目中有新增的{1}(需要用{2}函数包裹哟),就仅仅需要再次执行翻译命令{3}生成最新的语言包就可以了": "At this point, the project has been completely connected to internationalization. The above {0} specifies any of the target language, and the translated content can be seen on the page. If there are new {1} (need to be wrapped with {2} function) in the subsequent project, you only need to execute the translation command {3} again to generate the latest language package",
"其他属性与{0}参数一致": "The other attributes are consistent with the {0} parameter",
"其他参数与{0}参数一致": "The other parameters are consistent with the {0} parameters",
"需要国际化的内容": "Content that requires internationalization",
"新增{0}和{1}基础实现": "Add {0} and {1} basic implementations",
"为了避免不必要的重复文档内容,该库的部分文档是链接{0}中的内容": "To avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in {0}",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/usage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
// App.tsx
import React from 'react'
import { render } from 'react-dom'
import { useI18n } from '${showPackageName}'
import { I18nProvider, useI18n } from '${showPackageName}'
import i18nState from './i18n.ts'
function App() {
Expand Down Expand Up @@ -251,7 +251,7 @@ export default function SwitchLang() {
// App.tsx
import React from 'react'
import { render } from 'react-dom'
import { useI18n } from '${showPackageName}'
import { I18nProvider, useI18n } from '${showPackageName}'
import i18nState from './i18n.ts'
+ import SwitchLang from './SwitchLang'
Expand Down

0 comments on commit 20a8afc

Please sign in to comment.