Mercurial > defr > drupal > core
comparison modules/locale/locale.module @ 11:589fb7c02327 6.5
Drupal 6.5
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 23 Dec 2008 14:32:19 +0100 |
parents | fff6d4c8c043 |
children | 8b6c45761e01 |
comparison
equal
deleted
inserted
replaced
10:6f15c9d74937 | 11:589fb7c02327 |
---|---|
1 <?php | 1 <?php |
2 // $Id: locale.module,v 1.212.2.2 2008/07/09 21:48:28 goba Exp $ | 2 // $Id: locale.module,v 1.212.2.4 2008/09/08 21:51:50 dries Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * Add language handling functionality and enables the translation of the | 6 * Add language handling functionality and enables the translation of the |
7 * user interface to languages other than English. | 7 * user interface to languages other than English. |
49 return '<p>'. t('Add all languages 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>'; | 49 return '<p>'. t('Add all languages 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>'; |
50 case 'admin/settings/language/configure': | 50 case 'admin/settings/language/configure': |
51 $output = '<p>'. t("Language negotiation settings determine the site's presentation language. Available options include:") .'</p>'; | 51 $output = '<p>'. t("Language negotiation settings determine the site's presentation language. Available options include:") .'</p>'; |
52 $output .= '<ul><li>'. t('<strong>None.</strong> The default language is used for site presentation, though users may (optionally) select a preferred language on the <em>My Account</em> page. (User language preferences will be used for site e-mails, if available.)') .'</li>'; | 52 $output .= '<ul><li>'. t('<strong>None.</strong> The default language is used for site presentation, though users may (optionally) select a preferred language on the <em>My Account</em> page. (User language preferences will be used for site e-mails, if available.)') .'</li>'; |
53 $output .= '<li>'. t('<strong>Path prefix only.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the default language is used. <em>Example: "example.com/de/contact" sets presentation language to German based on the use of "de" within the path.</em>') .'</li>'; | 53 $output .= '<li>'. t('<strong>Path prefix only.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the default language is used. <em>Example: "example.com/de/contact" sets presentation language to German based on the use of "de" within the path.</em>') .'</li>'; |
54 $output .= '<li>'. t("<strong>Path prefix with language fallback.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the display language is determined by the user's language preferences from the <em>My Account</em> page, or by the browser's language settings. If a presentation language cannot be determined, the default language is used.") .'</t>'; | 54 $output .= '<li>'. t("<strong>Path prefix with language fallback.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the display language is determined by the user's language preferences from the <em>My Account</em> page, or by the browser's language settings. If a presentation language cannot be determined, the default language is used.") .'</li>'; |
55 $output .= '<li>'. t('<strong>Domain name only.</strong> The presentation language is determined by examining the domain used to access the site, and comparing it to the language domain (if any) specified for each language. If a match is not identified, the default language is used. <em>Example: "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.</em>') .'</li></ul>'; | 55 $output .= '<li>'. t('<strong>Domain name only.</strong> The presentation language is determined by examining the domain used to access the site, and comparing it to the language domain (if any) specified for each language. If a match is not identified, the default language is used. <em>Example: "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.</em>') .'</li></ul>'; |
56 $output .= '<p>'. t('The path prefix or domain name for a language may be set by editing the <a href="@languages">available languages</a>. In the absence of an appropriate match, the site is displayed in the <a href="@languages">default language</a>.', array('@languages' => url('admin/settings/language'))) .'</p>'; | 56 $output .= '<p>'. t('The path prefix or domain name for a language may be set by editing the <a href="@languages">available languages</a>. In the absence of an appropriate match, the site is displayed in the <a href="@languages">default language</a>.', array('@languages' => url('admin/settings/language'))) .'</p>'; |
57 return $output; | 57 return $output; |
58 case 'admin/build/translate': | 58 case 'admin/build/translate': |
59 $output = '<p>'. t('This page provides an overview of available translatable strings. Drupal displays translatable strings in text groups; modules may define additional text groups containing other translatable strings. Because text groups provide a method of grouping related strings, they are often used to focus translation efforts on specific areas of the Drupal interface.') .'</p>'; | 59 $output = '<p>'. t('This page provides an overview of available translatable strings. Drupal displays translatable strings in text groups; modules may define additional text groups containing other translatable strings. Because text groups provide a method of grouping related strings, they are often used to focus translation efforts on specific areas of the Drupal interface.') .'</p>'; |
232 '#type' => 'fieldset', | 232 '#type' => 'fieldset', |
233 '#title' => t('Language settings'), | 233 '#title' => t('Language settings'), |
234 '#weight' => 1, | 234 '#weight' => 1, |
235 ); | 235 ); |
236 | 236 |
237 // Get language negotiation settings. | 237 // Get language negotiation settings. |
238 $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); | 238 $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); |
239 $form['locale']['language'] = array( | 239 $form['locale']['language'] = array( |
240 '#type' => (count($names) <= 5 ? 'radios' : 'select'), | 240 '#type' => (count($names) <= 5 ? 'radios' : 'select'), |
241 '#title' => t('Language'), | 241 '#title' => t('Language'), |
242 '#default_value' => $user_preferred_language->language, | 242 '#default_value' => $user_preferred_language->language, |
259 '#type' => 'select', | 259 '#type' => 'select', |
260 '#title' => t('Language'), | 260 '#title' => t('Language'), |
261 '#options' => array('' => t('All languages')) + locale_language_list('name'), | 261 '#options' => array('' => t('All languages')) + locale_language_list('name'), |
262 '#default_value' => $form['language']['#value'], | 262 '#default_value' => $form['language']['#value'], |
263 '#weight' => -10, | 263 '#weight' => -10, |
264 '#description' => t('A path alias set for a specific language will always be used when displaying this page in that language, and takes precedence over path aliases set for <am>All languages</em>.'), | 264 '#description' => t('A path alias set for a specific language will always be used when displaying this page in that language, and takes precedence over path aliases set for <em>All languages</em>.'), |
265 ); | 265 ); |
266 break; | 266 break; |
267 | 267 |
268 // Language setting for content types | 268 // Language setting for content types |
269 case 'node_type_form': | 269 case 'node_type_form': |
335 | 335 |
336 if ($reset) { | 336 if ($reset) { |
337 // Reset in-memory cache. | 337 // Reset in-memory cache. |
338 $locale_t = NULL; | 338 $locale_t = NULL; |
339 } | 339 } |
340 | 340 |
341 if (!isset($string)) { | 341 if (!isset($string)) { |
342 // Return all cached strings if no string was specified | 342 // Return all cached strings if no string was specified |
343 return $locale_t; | 343 return $locale_t; |
344 } | 344 } |
345 | 345 |