Commit 5d5cadea authored by catch's avatar catch

Issue #1387586 by Gábor Hojtsy: Rename drupal_multilingual() to language_multilingual().

parent aafd8aaf
......@@ -2624,7 +2624,7 @@ function drupal_language_initialize() {
foreach ($types as $type) {
$GLOBALS[$type] = $default;
}
if (drupal_multilingual()) {
if (language_multilingual()) {
include_once DRUPAL_ROOT . '/core/includes/language.inc';
foreach ($types as $type) {
$GLOBALS[$type] = language_initialize($type);
......@@ -2653,7 +2653,7 @@ function drupal_language_types() {
/**
* Returns TRUE if there is more than one language enabled.
*/
function drupal_multilingual() {
function language_multilingual() {
// The "language_count" variable stores the number of enabled languages to
// avoid unnecessarily querying the database when building the list of
// enabled languages on monolingual sites.
......@@ -2686,7 +2686,7 @@ function language_list($field = 'language') {
// Init language list
if (!isset($languages)) {
$default = language_default();
if (drupal_multilingual() || module_exists('language')) {
if (language_multilingual() || module_exists('language')) {
$languages['language'] = db_query('SELECT * FROM {language} ORDER BY weight ASC, name ASC')->fetchAllAssoc('language');
}
else {
......
......@@ -6136,7 +6136,7 @@ function drupal_render_cid_parts($granularity = NULL) {
$cid_parts[] = $theme;
// If Locale is enabled but we have only one language we do not need it as cid
// part.
if (drupal_multilingual()) {
if (language_multilingual()) {
foreach (language_types_configurable() as $language_type) {
$cid_parts[] = $GLOBALS[$language_type]->language;
}
......
......@@ -278,7 +278,7 @@ function locale_multilingual_node_type($type_name) {
*/
function locale_form_alter(&$form, &$form_state, $form_id) {
// Only alter user forms if there is more than one language.
if (drupal_multilingual()) {
if (language_multilingual()) {
// Display language selector when either creating a user on the admin
// interface or editing a user account.
if ($form_id == 'user_register_form' || $form_id == 'user_profile_form') {
......@@ -977,7 +977,7 @@ function locale_block_info() {
* Displays a language switcher. Only show if we have at least two languages.
*/
function locale_block_view($type) {
if (drupal_multilingual()) {
if (language_multilingual()) {
$path = drupal_is_front_page() ? '<front>' : $_GET['q'];
$links = language_negotiation_get_switch_links($type, $path);
......@@ -999,7 +999,7 @@ function locale_block_view($type) {
*/
function locale_url_outbound_alter(&$path, &$options, $original_path) {
// Only modify internal URLs.
if (!$options['external'] && drupal_multilingual()) {
if (!$options['external'] && language_multilingual()) {
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast['callbacks'] = &drupal_static(__FUNCTION__);
......
......@@ -476,7 +476,7 @@ class PathMonolingualTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/config/regional/language', $edit, t('Save configuration'));
// Verify that French is the only language.
$this->assertFalse(drupal_multilingual(), t('Site is mono-lingual'));
$this->assertFalse(language_multilingual(), t('Site is mono-lingual'));
$this->assertEqual(language_default()->language, 'fr', t('French is the default language'));
// Set language detection to URL.
......
......@@ -207,7 +207,7 @@ function translation_form_node_form_alter(&$form, &$form_state) {
function translation_node_view($node, $view_mode) {
// If the site has no translations or is not multilingual we have no content
// translation links to display.
if (isset($node->tnid) && drupal_multilingual() && $translations = translation_node_get_translations($node->tnid)) {
if (isset($node->tnid) && language_multilingual() && $translations = translation_node_get_translations($node->tnid)) {
$languages = language_list('enabled');
$languages = $languages[1];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment