woocommerce/docs/contribution/contributing/zh-cn/string-localisation-guidelines.md
2026-04-15 10:18:01 +08:00

14 lines
No EOL
679 B
Markdown
Raw Permalink 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.

---
post_title: String localization guidelines
sidebar_label: String localization guidelines
---
# 字符串本地化指南
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](https://codex.wordpress.org/I18n_for_WordPress_Developers)。