summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-05 17:57:09 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-05 17:57:09 +0000
commit0614a78538bcc91f620abb38a0366d6ecee9eb06 (patch)
tree1ec0a02d33f0ea6eb4f3dec861a2a622fcc7bc3a /includes
parentb6fd2cd427ea059d92b85b8e378a2f644aa01089 (diff)
downloadbrdo-0614a78538bcc91f620abb38a0366d6ecee9eb06.tar.gz
brdo-0614a78538bcc91f620abb38a0366d6ecee9eb06.tar.bz2
#780318 by plach: Fixed path prefixes are always active on multilingual sites.
Diffstat (limited to 'includes')
-rw-r--r--includes/locale.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/includes/locale.inc b/includes/locale.inc
index 50f442907..4b2f00556 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -7,6 +7,32 @@
*/
/**
+ * The language is determined using a URL language indicator:
+ * path prefix or domain according to the configuration.
+ */
+define('LOCALE_LANGUAGE_NEGOTIATION_URL', 'locale-url');
+
+/**
+ * The language is set based on the browser language settings.
+ */
+define('LOCALE_LANGUAGE_NEGOTIATION_BROWSER', 'locale-browser');
+
+/**
+ * The language is determined using the current interface language.
+ */
+define('LOCALE_LANGUAGE_NEGOTIATION_INTERFACE', 'locale-interface');
+
+/**
+ * The language is set based on the user language settings.
+ */
+define('LOCALE_LANGUAGE_NEGOTIATION_USER', 'locale-user');
+
+/**
+ * The language is set based on the request/session parameters.
+ */
+define('LOCALE_LANGUAGE_NEGOTIATION_SESSION', 'locale-session');
+
+/**
* Regular expression pattern used to localize JavaScript strings.
*/
define('LOCALE_JS_STRING', '(?:(?:\'(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+');
@@ -156,6 +182,10 @@ function locale_language_from_session($languages) {
function locale_language_from_url($languages) {
$language_url = FALSE;
+ if (!language_negotiation_get_any(LOCALE_LANGUAGE_NEGOTIATION_URL)) {
+ return $language_url;
+ }
+
switch (variable_get('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX)) {
case LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX:
// $_GET['q'] might not be available at this time, because