title: "字符串本地化指南" post_status: publish comment_status: open taxonomy: category: - woocommerce post_tag: - Contributing - Contribution - Repos
字符串本地化指南
- 在所有字符串中使用
woocommercetextdomain。 - 当在
printf/sprintf中使用动态字符串时,如果需要替换多个字符串,请使用编号参数。例如,Test %s string %s.应该改为Test %1$s string %2$s. - 使用句首字母大写形式。例如,
Some Thing应该改为Some thing。 - 避免使用 HTML。如果需要,请使用
sprintf插入 HTML。
更多信息,请参阅 WordPress 核心文档 i18n for WordPress Developers。