WooCommerce 文档

title: "字符串本地化指南" post_status: publish comment_status: open taxonomy: category: - woocommerce post_tag: - Contributing - Contribution - Repos


字符串本地化指南

  1. 在所有字符串中使用 woocommerce textdomain。
  2. 当在 printf/sprintf 中使用动态字符串时,如果需要替换多个字符串,请使用编号参数。例如,Test %s string %s. 应该改为 Test %1$s string %2$s.
  3. 使用句首字母大写形式。例如,Some Thing 应该改为 Some thing
  4. 避免使用 HTML。如果需要,请使用 sprintf 插入 HTML。

更多信息,请参阅 WordPress 核心文档 i18n for WordPress Developers