document localization template interpolation, like ${0}
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
从 https://lit.dev/docs/localization/overview/ 的本地化概览开始,并将其中关于插值的指导与 packages/localize-tools/testdata/build-runtime-xliff/goldens/tsout/zh_CN.ts 中引用的 localize-tools 测试输出进行比较。记录索引插值和命名插值的工作方式,包括示例所展示的限制,并验证由此得到的指导是否回答了是否支持其他模板逻辑这一问题。
由索引模型根据 Issue 内容生成。
描述
please update or expand the localization docs to help those (manually) creating templates for runtime localization that show how to use interpolation and what does and doesn't work, for example a template such as atemplate: (args)=>html'some text ${ args.named } does not appear to work and it's unclear if the indexed approach shown below is the only option available
thanks very much.
// templates has key with the template:
check_email: html`checking ${ 0 }`,
...
check_email_does_not_work: (args)=>html`checking ${ args.address }`
// unclear how to make the above templates work, except for the index approach 0, 1...
// and whether this is the only option available for logic in templates
const address = `user@host`;
msg(str`checking...${address}`, {id:'check_email'})
// like
greeting: html`<b>Hola Mundo</b>`,
parameterized: html`<b>Hola ${0}</b>`,
htmlOrderChange: html`<b>2:${1} 1:${0}</b>`,
docs at:
https://lit.dev/docs/localization/overview/
current source of information in tests:
https://github.com/search?q=repo%3Alit%2Flit%20localize%20%7B0%7D&type=code
https://github.com/lit/lit/blob/a66737fc9b861999b00ccad01edb925172b7f711/packages/localize-tools/testdata/build-runtime-xliff/goldens/tsout/zh_CN.ts#L5
- 主要语言
- TypeScript
- 星标
- 140
- 派生
- 229
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lit/lit.dev 的其他 Issue
-
The example for `when` doesn't show that it takes the condition value as a parameter可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1-3 小时 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 62/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
GetStream/stream-chat-react#3467 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vercel-labs/ui#1139 ·
维护者通常 1 天内回复
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10可能已有人在做 @goranai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bot:ai-assisted component:platform-js status:untriaged
难度 2/5 1-3 小时 新手友好度 82/100
midnightntwrk/platform-js#93 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100