summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/common.inc4
-rw-r--r--modules/node.module5
-rw-r--r--modules/node/node.module5
-rw-r--r--themes/bluemarine/xtemplate.xtmpl2
-rw-r--r--themes/chameleon/chameleon.theme4
-rw-r--r--themes/engines/xtemplate/xtemplate.engine1
-rw-r--r--themes/pushbutton/xtemplate.xtmpl2
7 files changed, 13 insertions, 10 deletions
diff --git a/includes/common.inc b/includes/common.inc
index b138d79b5..ce388c2e9 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -508,7 +508,9 @@ function locale_initialize() {
$languages = $languages['name'];
}
else {
- $languages = array();
+ // Ensure the locale/language is correctly returned, even without locale.module.
+ // Useful for e.g. XML/HTML 'lang' attributes.
+ $languages = array('en' => 'English');
}
if ($user->uid && $languages[$user->language]) {
return $user->language;
diff --git a/modules/node.module b/modules/node.module
index d750593cb..e4773d569 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -993,8 +993,7 @@ function node_block($op = 'list', $delta = 0) {
* The link should be an absolute URL.
*/
function node_feed($nodes = 0, $channel = array()) {
- global $base_url;
- $languages = (function_exists('locale')) ? locale_supported_languages() : array('name' => array());
+ global $base_url, $locale;
if (!$nodes) {
$nodes = db_query_range('SELECT nid FROM {node} WHERE promote = 1 AND status = 1 ORDER BY created DESC', 0, 15);
@@ -1012,7 +1011,7 @@ function node_feed($nodes = 0, $channel = array()) {
'title' => variable_get('site_name', 'drupal') .' - '. variable_get('site_slogan', ''),
'link' => $base_url,
'description' => variable_get('site_mission', ''),
- 'language' => (($key = reset(array_keys($languages['name']))) ? $key : 'en')
+ 'language' => $locale
);
$channel = array_merge($channel_defaults, $channel);
diff --git a/modules/node/node.module b/modules/node/node.module
index d750593cb..e4773d569 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -993,8 +993,7 @@ function node_block($op = 'list', $delta = 0) {
* The link should be an absolute URL.
*/
function node_feed($nodes = 0, $channel = array()) {
- global $base_url;
- $languages = (function_exists('locale')) ? locale_supported_languages() : array('name' => array());
+ global $base_url, $locale;
if (!$nodes) {
$nodes = db_query_range('SELECT nid FROM {node} WHERE promote = 1 AND status = 1 ORDER BY created DESC', 0, 15);
@@ -1012,7 +1011,7 @@ function node_feed($nodes = 0, $channel = array()) {
'title' => variable_get('site_name', 'drupal') .' - '. variable_get('site_slogan', ''),
'link' => $base_url,
'description' => variable_get('site_mission', ''),
- 'language' => (($key = reset(array_keys($languages['name']))) ? $key : 'en')
+ 'language' => $locale
);
$channel = array_merge($channel_defaults, $channel);
diff --git a/themes/bluemarine/xtemplate.xtmpl b/themes/bluemarine/xtemplate.xtmpl
index fbeef1e58..c9a41cd88 100644
--- a/themes/bluemarine/xtemplate.xtmpl
+++ b/themes/bluemarine/xtemplate.xtmpl
@@ -1,5 +1,5 @@
<!-- BEGIN: header --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="{language}" xml:lang="{language}">
<head>
<title>{head_title}</title>
diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme
index 154cb2e4b..307d87615 100644
--- a/themes/chameleon/chameleon.theme
+++ b/themes/chameleon/chameleon.theme
@@ -24,8 +24,10 @@ function chameleon_page($content, $title = NULL, $breadcrumb = NULL) {
drupal_set_breadcrumb($breadcrumb);
}
+ $language = $GLOBALS['locale'];
+
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
- $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n";
+ $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$language\" xml:lang=\"$language\">\n";
$output .= "<head>\n";
$output .= " <title>". ($title ? $title ." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")) ."</title>\n";
$output .= drupal_get_html_head();
diff --git a/themes/engines/xtemplate/xtemplate.engine b/themes/engines/xtemplate/xtemplate.engine
index 2b91f70d7..14bd20a55 100644
--- a/themes/engines/xtemplate/xtemplate.engine
+++ b/themes/engines/xtemplate/xtemplate.engine
@@ -120,6 +120,7 @@ function xtemplate_page($content, $title = NULL, $breadcrumb = NULL) {
global $xtemplate;
$xtemplate->template->assign(array(
+ "language" => $GLOBALS['locale'],
"head_title" => (drupal_get_title() ? drupal_get_title() ." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")),
"head" => drupal_get_html_head(),
"styles" => theme_get_styles(),
diff --git a/themes/pushbutton/xtemplate.xtmpl b/themes/pushbutton/xtemplate.xtmpl
index dbd6bdb9b..a18a8118c 100644
--- a/themes/pushbutton/xtemplate.xtmpl
+++ b/themes/pushbutton/xtemplate.xtmpl
@@ -1,5 +1,5 @@
<!-- BEGIN: header --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="{language}" xml:lang="{language}">
<head>
<title>{head_title}</title>
{head}