diff --git a/admin/settings/language.php b/admin/settings/language.php
index 51fd03c..7c4a485 100644
--- a/admin/settings/language.php
+++ b/admin/settings/language.php
@@ -18,6 +18,8 @@ if ($hassiteconfig
     // new CFG variable for excel encoding
     $temp->add(new admin_setting_configselect('latinexcelexport', get_string('latinexcelexport', 'admin'), get_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
 
+    // new CFG variable for docs language
+    $temp->add(new admin_setting_configselect('doclang', get_string('doclang', 'admin'), get_string('configdoclang', 'admin'), current_language(), get_list_of_languages(false, true)));
 
     $ADMIN->add('language', $temp);
 
diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php
index 056bc25..8c08205 100644
--- a/lang/en_utf8/admin.php
+++ b/lang/en_utf8/admin.php
@@ -103,6 +103,7 @@ $string['configdenyemailaddresses'] = 'To deny email addresses from particular d
 $string['configdigestmailtime'] = 'People who choose to have emails sent to them in digest form will be emailed the digest daily. This setting controls which time of day the daily mail will be sent (the next cron that runs after this hour will send it).';
 $string['configdisableuserimages'] = 'Disable the ability for users to change user profile images.';
 $string['configdisplayloginfailures'] = 'This will display information to selected users about previous failed logins.';
+$string['configdoclang'] = 'This language will be used in links for the documentation pages with.';
 $string['configdocroot'] = 'Defines the path to the Moodle Docs. You can change this if you wish to have your own custom online documentation. However, if you do that make sure that the paths in your documentation follow the same format as http://docs.moodle.org.';
 $string['configdoctonewwindow'] = 'If you enable this, then links to Moodle Docs will be shown in a new window.';
 $string['configeditorfontlist'] = 'Select the fonts that should appear in the editor\'s drop-down list.';
@@ -334,6 +335,7 @@ $string['disablecourseajax'] = 'Disable AJAX course editing';
 $string['disableuserimages'] = 'Disable User Profile Images';
 $string['displayerrorswarning'] = 'Enabling the PHP setting <em>display_errors</em> is not recommended on production sites because some error messages may reveal sensitive information about your server.';
 $string['displayloginfailures'] = 'Display login failures to';
+$string['doclang'] = 'Language for docs';
 $string['docroot'] = 'Moodle Docs document root';
 $string['doctonewwindow'] = 'Open in new window';
 $string['download'] = 'Download';
diff --git a/lib/weblib.php b/lib/weblib.php
index 6fa0a95..cd577e6 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -6927,7 +6927,7 @@ function doc_link($path='', $text='', $iconpath='') {
         $target = ' target="_blank"';
     }
 
-    $lang = str_replace('_utf8', '', current_language());
+    $lang = str_replace('_utf8', '', $CFG->doclang);
 
     $str = '<a href="' .$CFG->docroot. '/' .$lang. '/' .$path. '"' .$target. '>';
 
