tachybase_todo/docs/plugins/concepts/locales.md
chenos d5d0e1036b
docs: add docs (#75)
* docs: add docs

* ignore dumi theme test

* fix: error TS2717: Subsequent property declarations must have the same type.

* update docs

* deploy gh-pages

* plugins docs

* hash & cname

* exportStatic

* ssr

* vercel

* vercel

* fix: deploy vercel

* Delete vercel.json

* docs

* fix APP_DIST

* on master branch
2021-04-17 21:33:21 +08:00

35 lines
569 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Locales - 国际化
---
# Locales - 国际化 <Badge>未实现</Badge>
NocoBase 采用 [formatjs](https://formatjs.io/docs/getting-started/installation) 来处理国际化问题。
直接写在代码里,详情参考 formatjs 用例NocoBase 会封装一个更易用的 `__` 函数来处理国际化,如:
```ts
__('Hello, {name}');
```
在配置里有两种写法:
模板字符串:
```ts
{
name: `{{ __('Hello, {name}') }}`
}
```
json 格式:
```ts
{
name: {
'zh-CN': '{name},您好',
'en-US': 'Hello, {name}',
},
}
```