Internationalization and Localization

When you are developing WordPress themes and plugins, you should have the scope of your website and its audience in your mind. By doing so, you can help people translate your work into other languages. This is known as internationalization – abbreviated as i18n in WordPress.

And the process of translating an internationalized theme or plugin to another language is known as localization – abbreviated as l10n.

By internationalizing your theme or plugin, you are making way for other people who are proficient in other languages to translate your plugin into their language. This allows your code to be used by people who rely on those languages to manage their WordPress sites. You can read more about it from Internationalization handbook page.

Common WordPress APIs: Internationalization by Jonathan Bossenger

Exercise

Create a WordPress plugin that displays the message “Welcome to your WordPress admin dashboard! Customize your site with ease.” in the admin panel using the admin_notices action. Ensure the plugin is internationalization-ready by:

  • Using a text domain for the plugin.
  • Including functions for loading the text domain.
  • Wrapping all displayed strings in internationalization functions like __() or _e().
  • Optionally, modify the plugin to display the message only to administrators with their name and ID.

References

Ideas to Explore:

  • What is i18n in WordPress?
  • What is l10n in WordPress?
  • What is a locale related to l10n?
  • What is a WordPress locale code? What are the WordPress locale codes for Gujrati, French, and German?
  • What are translation files (.po and .mo) in WordPress?
  • How do you prepare a WordPress theme for internationalization?
  • How can you implement internationalization in custom plugins and themes?
  • What is the role of the .pot file in the WordPress localization process?