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: , , , ,


One Response to “l10n”

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

    […] 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. […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: