Comments (9)
demo 的 title, description 如何国际化?
目前 hooks 的做法是:
- demo 本身只要英文的,没有中文的。
- demo 的 title/description 有中英文区别。
from dumi.
只要没有带 lang 部分的 markdown,就会被当做默认语言渲染。例如,如果我的文档站默认英文,那么我的 markdown 文件应该是 index.md 和 index.zh-CN.md;如果我的文档站默认中文,那么我的 markdown 文件应该是 index.md 和 index.en-US.md
这样 Select 好像并不知道默认语言是什么。
感觉可以是约定 + 可配置式的,比如在 .umirc 里配置一下每个语言的别名:
languages: {
default: '中文',
'en-US': 'English',
'zh-TW': '繁體中文'
}
这样 Select 的下拉框里可以就显示: 中文、English、繁體中文
from dumi.
demo 的 title, description 如何国际化
@brickspert title 和 desc 可以考虑增加字段,比如 title.zh-CN
from dumi.
这样 Select 好像并不知道默认语言是什么。
@tli4 好角度…确实有这个尴尬的问题存在,看来不可避免要提供配置了🤦♂️
from dumi.
这个 lang 原则上不限制格式,也就是说我们写 en 或者 en-US 都会被检测到。
原则上来说不限制格式并没有多余的好处,统一约定好 lang 就好。如 *.zh-CN
为中文
from dumi.
原则上来说不限制格式并没有多余的好处,统一约定好 lang 就好。如 *.zh-CN 为中文
@xiaohuoni 有些用户可能需要在路由上隐藏掉地区,比如 zh-CN
在路由上仅显示为 zh
,要支持这个的话就得扩展新配置了
from dumi.
/en/filename -> filename-cn 比较好一点。
/en 你不知道应该放在哪一级,比如 /a/b/c/filename,你不好设置 /en
from dumi.
@chenjsh36 en 永远在最顶层,一般的国际化站点都是这么搞的吧
from dumi.
根据此前的讨论情况提了个 PR,各位一起 review 下:#58
from dumi.
Related Issues (20)
- bug: 在windows系统下,打包后文件名带":"导致命名失败 HOT 1
- bug: linux下执行docs:build报错 HOT 3
- bug: 代码中的`title`被错误地渲染到侧边栏的目录中 HOT 1
- bug: MFSU esbuild bundler is not supported yet! HOT 1
- bug: defineApp 未导出 HOT 1
- bug: defineApp 未导出
- feat: default order of docs more friendly for human HOT 5
- bug: sidebar激活的锚点不对 HOT 1
- feat: Markdown里支持通过变量替换文本 HOT 2
- bug: When customizing the `resolve.docDirs` directory, .md files under the node_modules file are not ignored in Monorepo project HOT 2
- 使用worker-loader,出现报错Module not found: Error: Can't resolve 'mf/worker-loader' HOT 2
- bug: 通过 `resolve.atomDirs` 指定多个资产路径时,Demo 无法正常显示。
- feat: 希望支持vite+react-ts HOT 1
- feat: dumi2 的 自动API表格 生成太慢了,热更新也很慢 HOT 2
- bug: useRouteMatch was not found in 'react-router' HOT 1
- feat:umi4集成模式 HOT 2
- bug: npx create-dumi初始化项目失败 HOT 2
- feat: Dumi 支不支持Taro ? HOT 4
- bug: md中代码块的import/export无法通过编译 HOT 1
- feat: dumi2集成umi4什么时候支持 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dumi.