WordPress supports Localization using the gettext framework. l10n global variable is used to store all the readers corresponding to the different languages supported. It is set in the function load_textdomain($domain, $mofile) defined in [wordpress root folder]/wp-includes/wp-l10n.php. Following functions are defined which internally use this function:

  • load_default_textdomain(): loads the default textdomain
  • load_plugin_textdomain($domain, $path = 'wp-content/plugins'): loads text domain defined in the plugins
  • load_theme_textdomain($domain): loads text domain defined in the theme

Loading of the text domain involves looking up for corresponding mo file with the same name as the locale.

The default domain is loaded using the function load_default_textdomain() in [wordpress root folder]/wp-settings.php.

Plugin or theme developers need not use this global variable directly. WordPress provides functions to translate text in localized language.

Back to full list of global variables.

Technorati tags: , , , ,

Discussion [Participate or Link]

  1. Abhijit Nadgouda @ iface » Blog Archive » weekday said:

    […] WordPress uses weekday global variable to access, exactly what it says, names of the weekdays. It is a one dimensional array set in the file [wordpress root folder]/wp-includes/locale.php. It stores localized values. Additional global variables like weekday_initial, weekday_abbrev, month, month_abbrev are also defined. […]

  2. references» Blog Archive » Wordpress Global Variables said:

    […] $l10n […]

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.



Abhijit Nadgouda
iface Consulting
+91 9819820312
My bookmarks


This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.