Difference between revisions of "Customising/Language Strings"

From Mahara Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
From Mahara 1.2, administrators can put modified (or new) language files into the local/lang directory, and the strings in those files will override the strings in the installed language packs.
+
Administrators can put modified (or new) language files into the local/lang directory, and the strings in those files will override the strings in the installed language packs.
  
For example, say you want to change the string "Logout" to "Let me out!".  This string is defined in htdocs/lang/en.utf8/mahara.php.  You can create the file htdocs/local/lang/en.utf8/mahara.php with the following contents:
+
For example, say you want to change the string "Logout" to "Let me out!".  This string is defined in <code>htdocs/lang/en.utf8/mahara.php</code>.  You can create the file <code>htdocs/local/lang/en.utf8/mahara.php</code> with the following contents:
  
+
<source lang="php">
+
<?php
 +
 
 +
$string['logout'] = "Let me out!";
 +
</source>
  
 
There is no need to edit the original language files, so updating the site to newer versions of Mahara will be easier -- there is no need to merge local changes to the language files with the updated versions.
 
There is no need to edit the original language files, so updating the site to newer versions of Mahara will be easier -- there is no need to merge local changes to the language files with the updated versions.
  
Strings used by plugins are stored in files like htdocs/artefact/file/lang/en.utf8/artefact.file.php.  These strings can be overridden by creating htdocs/local/lang/en.utf8/artefact.file.php.
+
Strings used by plugins are stored in files like <code>htdocs/artefact/file/lang/en.utf8/artefact.file.php</code>.  These strings can be overridden by creating <code>htdocs/local/lang/en.utf8/artefact.file.php</code>.
 +
[[Category:Customising]]
 +
 
 +
For the full gritty details of lang strings, see [[Developer Area/Language strings]]

Latest revision as of 12:38, 10 February 2016

Administrators can put modified (or new) language files into the local/lang directory, and the strings in those files will override the strings in the installed language packs.

For example, say you want to change the string "Logout" to "Let me out!".  This string is defined in htdocs/lang/en.utf8/mahara.php.  You can create the file htdocs/local/lang/en.utf8/mahara.php with the following contents:

<?php

$string['logout'] = "Let me out!";

There is no need to edit the original language files, so updating the site to newer versions of Mahara will be easier -- there is no need to merge local changes to the language files with the updated versions.

Strings used by plugins are stored in files like htdocs/artefact/file/lang/en.utf8/artefact.file.php.  These strings can be overridden by creating htdocs/local/lang/en.utf8/artefact.file.php.

For the full gritty details of lang strings, see Developer Area/Language strings