locale

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

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: