Skip to content

Commit

Permalink
Add galician and basque + add forced change language when using get p…
Browse files Browse the repository at this point in the history
…aram

 See BT#10815
  • Loading branch information
jmontoyaa committed Feb 11, 2016
1 parent 870361f commit 1fc0137
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 11 additions & 2 deletions custompages/language.php
Expand Up @@ -35,8 +35,17 @@ function custompages_get_lang($variable) {
return get_lang($variable, null, $_SESSION['user_language_choice']);
}

$available_langs = array('en', 'fr', 'es');
$chamilo_langs = array(null => 'english', 'en' => 'english', 'fr' => 'french', 'nl' => 'dutch', 'de' => 'german', 'es' => 'spanish');
$available_langs = array('en', 'fr', 'es', 'gl', 'eu');
$chamilo_langs = array(
null => 'english',
'en' => 'english',
'fr' => 'french',
'nl' => 'dutch',
'de' => 'german',
'es' => 'spanish',
'gl' => 'galician',
'eu' => 'basque'
);
$lang_match = $chamilo_langs[get_preferred_language($available_langs)];
// recover previous value ...
if (isset($_SESSION['user_language_choice']))
Expand Down
5 changes: 5 additions & 0 deletions main/inc/global.inc.php
Expand Up @@ -453,6 +453,10 @@
}
}

// If language is set via browser ignore the priority
if (isset($_GET['language'])) {
$language_interface = $user_language;
}
}

// Sometimes the variable $language_interface is changed
Expand Down Expand Up @@ -487,6 +491,7 @@
include $langpath.'english/trad4all.inc.php';
// prepare string for current language
$langfile = $langpath.$language_interface.'/trad4all.inc.php';

if (file_exists($langfile)) {
include $langfile;
}
Expand Down

0 comments on commit 1fc0137

Please sign in to comment.