插件开发文档

多语言国际化

💡 云策文档标注

概述

本文档介绍了 WordPress 插件国际化(i18n)的基本概念和重要性,旨在帮助开发者编写易于翻译的代码,以支持全球用户。

关键要点

  • 国际化(i18n)是开发插件时使其能轻松翻译成其他语言的过程。
  • WordPress 在全球使用,插件字符串需特殊编码以支持本地化,无需修改源代码。
  • 文档提供了进一步学习资源,包括视频、文章和指南,如“How to Internationalize your Plugin”。

📄 原文内容

What is Internationalization?

Internationalization is the process of developing a plugin so it can easily be translated into other languages. Internationalization is often abbreviated as i18n (because there are 18 letters between the letters i and n).

Why is Internationalization Important?

WordPress is used all over the world, in countries where English is not the main language. The strings in the WordPress plugins need to be coded in a special way so that can be easily translated into other languages. As a developer, you may not be able to provide localizations (meaning, changes required to the text and other things like number formats specific to a given locale (location))for all your users; however, a translator can successfully localize the theme without needing to modify the source code itself.

Read further on “How to Internationalize your Plugin“.

Resources