Skip to content

Commit

Permalink
Added ability to force the language segment or query string value for…
Browse files Browse the repository at this point in the history
… default languages
  • Loading branch information
David McReynolds committed Sep 30, 2014
1 parent ac21f57 commit 09ebe43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions fuel/modules/fuel/config/fuel.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
// Append the current language value to the site URL automatically
$config['add_language_to_site_url'] = FALSE;

// force the default language segment, or query string on any URLs created with site_url
$config['language_force_default_to_site_url'] = FALSE;

// The name of the query string parameter to use for setting the language
$config['language_query_str_param'] = 'lang';

Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/libraries/Fuel_language.php
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ function uri($uri = '', $lang = NULL)
$uri = $this->cleaned_uri($uri);

// if $lang is set then we will check to see if it is a legit language and use it
if (!empty($lang) AND $lang != $this->is_default($lang) AND !in_array($lang_seg, $no_lang))
if (!empty($lang) AND ($lang != $this->is_default($lang) OR $this->fuel->config('language_force_default_to_site_url')) AND !in_array($lang_seg, $no_lang))
{
if (!$this->is_mode('query_string'))
{
Expand Down

0 comments on commit 09ebe43

Please sign in to comment.