diff options
Diffstat (limited to 'modules/locale/locale.module')
-rw-r--r-- | modules/locale/locale.module | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module index b091f12af..906aaf4c6 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -24,9 +24,9 @@ define('LOCALE_LANGUAGE_NEGOTIATION_URL', 'locale-url'); define('LOCALE_LANGUAGE_NEGOTIATION_BROWSER', 'locale-browser'); /** - * The language is determined using the current content language. + * The language is determined using the current interface language. */ -define('LOCALE_LANGUAGE_NEGOTIATION_CONTENT', 'locale-content'); +define('LOCALE_LANGUAGE_NEGOTIATION_INTERFACE', 'locale-interface'); /** * The language is set based on the user language settings. @@ -69,7 +69,7 @@ function locale_help($path, $arg) { case 'admin/config/regional/language/add': return '<p>' . t('Add a language to be supported by your site. If your desired language is not available in the <em>Language name</em> drop-down, click <em>Custom language</em> and provide a language code and other details manually. When providing a language code manually, be sure to enter a standardized language code, since this code may be used by browsers to determine an appropriate display language.') . '</p>'; case 'admin/config/regional/language/configure': - $output = '<p>' . t("Define how to decide which language is used to display content (text that you create and edit) and user interface text (text provided by Drupal and modules, such as field labels and help text). This decision is made by evaluating a series of detection methods for languages; the first detection method that gets a result will determine which language is used for that type of text. Define the order of evaluation of language detection methods on this page.") . '</p>'; + $output = '<p>' . t("Define how to decide which language is used to display page elements (primarily text provided by Drupal and modules, such as field labels and help text). This decision is made by evaluating a series of detection methods for languages; the first detection method that gets a result will determine which language is used for that type of text. Define the order of evaluation of language detection methods on this page.") . '</p>'; return $output; case 'admin/config/regional/language/configure/session': $output = '<p>' . t('Determine the language from a request/session parameter. Example: "http://example.com?language=de" sets language to German based on the use of "de" within the "language" parameter.') . '</p>'; @@ -466,17 +466,26 @@ function locale_entity_info_alter(&$entity_info) { /** * Implements hook_language_types_info(). + * + * Defines the three core language types: + * - Interface language is the only configurable language type in core. It is + * used by t() as the default language if none is specified. + * - Content language is by default non-configurable and inherits the interface + * language negotiated value. It is used by the Field API to determine the + * display language for fields if no explicit value is specified. + * - URL language is by default non-configurable and is determined through the + * URL language provider. It is used by l() as the default language if none is + * specified. */ function locale_language_types_info() { return array( - LANGUAGE_TYPE_CONTENT => array( - 'name' => t('Content language detection'), - 'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'), - ), LANGUAGE_TYPE_INTERFACE => array( - 'name' => t('User interface text language detection'), + 'name' => t('User interface text'), 'description' => t('Order of language detection methods for user interface text. If a translation of user interface text is available in the detected language, it will be displayed.'), ), + LANGUAGE_TYPE_CONTENT => array( + 'fixed' => array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE), + ), LANGUAGE_TYPE_URL => array( 'fixed' => array(LOCALE_LANGUAGE_NEGOTIATION_URL), ), @@ -534,13 +543,13 @@ function locale_language_negotiation_info() { 'description' => t("Determine the language from the browser's language settings."), ); - $providers[LOCALE_LANGUAGE_NEGOTIATION_CONTENT] = array( - 'types' => array(LANGUAGE_TYPE_INTERFACE), - 'callbacks' => array('language' => 'locale_language_from_content'), + $providers[LOCALE_LANGUAGE_NEGOTIATION_INTERFACE] = array( + 'types' => array(LANGUAGE_TYPE_CONTENT), + 'callbacks' => array('language' => 'locale_language_from_interface'), 'file' => $file, 'weight' => 8, - 'name' => t('Content'), - 'description' => t('Use the detected content language.'), + 'name' => t('Interface'), + 'description' => t('Use the detected interface language.'), ); return $providers; |