WordPress supports internationalization (i18n) and localization (l10n). A locale is indicated by the combination of the language and the region (usually the country). It is represented with ISO codes of the language and countries, e.g., en_US for US Enligsh, en_GB for British English and so on. US English is the default locale. locale global variable is used to store the current locale. It is set in the function get_locale() defined in [wordpress root folder]/wp-includes/wp-l10n.php.

WordPress uses this global variable internally to load the current locale. If the locale is not set already, it takes the value of WPLANG defined in [wordpress root folder]/wp-config.php. If that is empty it falls back to the default locale which is US English.

Plugin and theme developers need not use this global variable as it is part of the internationalization and localization framework. WordPress provides functions for translation.

Back to full list of global variables.

Technorati tags: , , , ,

Discussion [Participate or Link]

  1. Wordpress Global Variables | iface thoughts said:

    […] $locale […]

  2. WordPress Global Variables | iFansClub said:

    […] $locale […]

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.