Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Language editing.

Language editing: Difference between revisions

From MoodleDocs
m (remove edit section links)
m (The 2.0 specific part moved to the Language customization page)
 
(46 intermediate revisions by 15 users not shown)
Line 1: Line 1:
__NOEDITSECTION__
<p class="note">'''Note:''' Language editing has been improved in Moodle 2.0 onwards. See [[Language customization]] for details.</p>
== Manage language ==
{{Moodle 1.6}}
Moodle 1.6 includes a [[Language import utility]].


== Edit strings ==
{{Moodle 1.6}}
Text in Moodle may be changed by editing the language strings, either via Administration >> [[Configuration]] >> Language or directly e.g. in ''moodledata/lang/en''.


==Local language pack==
Location: ''Administration > Language > Language editing''
Sometimes, you may wish to change the default terms or language strings used in Moodle. For example, you may wish to replace all occurences of "course" with "class." To ensure that any changes are not overwritten by a new version when upgrading, you need to create your own local language pack as follows:


* Copy the ''langconfig.php'' of your language folder (e.g. ''moodledata/lang/en'') into a new folder (e.g. ''moodledata/lang/en_local''). You will need access to the server to achieve this step - it cannot be done from within Moodle.
== Edit words or phrases ==
* Add a string for parentlanguage to this file, which points to the language which is the most similar to yours.
[[Image:Editing-language-moodle-19.gif|thumb|Edit words or phrases in Moodle 1.9.5]]The language editing interface enables you to easily change any word or phrase used on the site. For example, you may want to change the word "Course" to "Area".
* Make your local language pack the default for the site via Administration >> [[Configuration]] >> [[Variables]].
* Edit only those strings you want to change with the built-in language editor, to be found in Administration >> [[Configuration]] >> Language.


The hierarchy of language packs can support up to three levels, the parent language, a sitewide local language pack, and a course level language pack. Moodle will first look for a string in the course level language pack, and if it does not find it, it will use the sitewide language pack, and then use the parent language string by default.
To edit a word or phrase:
#Access ''Administration > Language > Language editing''.
#Click the "Edit words or phrases" link in the middle of the page.
#Choose a file to edit. You may need to search through a few files before finding the file containing the word you wish to change. The file ''moodle.php'' contains all common site-wide phrases.
#Change the word or phrase.
#Click the "Save changes" button. The changed phrase will be highlighted in a different color.


If you are having trouble figuring out where a particular string you wish to change is located, you will need to perform a search for it. An easy way to do this is to use a program like [http://www.webattack.com/get/amcodesearch.html AM Code Search] which allows you to search for strings inside php files, unlike the Windows search.
Note: In versions of Moodle prior to 1.9, it is necessary to click the "Switch lang directory" button on the edit words or phrases page. A local language folder, ''parentlanguage_local'', will then be automatically created in ''moodledata/lang''. Files of edited strings will then be saved in this folder. This is necessary to prevent changes that you make being overwritten by a newer language pack when updating. In Moodle 1.9 onwards, the option to switch is no longer provided as edited strings are automatically saved in the local language folder.


==Previous admin/lang==
If you wish to make further changes later, be sure to check that files of edited strings will again be saved to the folder ''parentlanguage_local'', switching folder if necessary.
{{Moodle 1.5}}
Text in Moodle may be changed by editing the language strings, either via Administration >> [[Configuration]] >> Language or directly e.g. in ''lang/en''.


'''Local language pack'''
==Changes in 1.9==
 
[[Image:screenshot-admin-lang-19.png|thumb|Language pack maintaining in Moodle 1.9]]
To ensure that any changes are not overwritten by a new version when upgrading, you need to create your own local language pack as follows:
{{Moodle 1.9}}* From Moodle 1.9 onwards, only users with the capability [[Capabilities/moodle/site:langeditmaster|moodle/site:langeditmaster]] may modify the master language packages (i.e. those being saved in ''moodledata/lang/''). By default, the admin role has this capability set to "''prevent''". It is expected that only language maintainers will manually allow this for themselves. Language pack maintainers have an additional "Language pack maintaining" tab.
 
* From Moodle 1.9 onwards, only users with the capability [[Capabilities/moodle/site:langeditlocal|moodle/site:langeditlocal]] may customize the site translation (i.e. files being saved in ''moodledata/lang_local/''). Admins are allowed to do this by default.
* Copy the contents of your language folder (e.g. ''lang/en'') into a new folder (e.g. ''lang/en_local'') - you will need access to the server to achieve this step, it cannot be done from within Moodle.
* Added ability to edit language files in non-standard locations, i.e. string files for various types of plugin (e.g. blocks, database presets, 3rd party modules etc.)
* Make your local language pack the default for the site via Administration >> [[Configuration]] >> [[Variables]].


== See also ==
== See also ==


* [[Language FAQ]]
* [[Translation]]
* [[Translation]]
* Using Moodle [http://moodle.org/mod/forum/view.php?id=43 Languages forum]
* [[Local language]]
* [[Development:Places to search for lang strings]]
* [[Language customization]] for language editing in Moodle 2.0
* [http://www.moodletutorials.org/view_video.php?viewkey=4a10e0db5e4b97fc2af3 Tutorial Showing How to Change a Word or Phrase in Moodle 1.9]
Using Moodle forum discussions:
* [http://moodle.org/mod/forum/discuss.php?d=49150 Local language]
* [http://moodle.org/mod/forum/discuss.php?d=78225 Editing help files]


[[Category: Administrator]]
[[Category:Language]]
[[Category:Language]]


[[es:admin/lang]]
[[es:admin/lang]]
[[fr:Langue]]
[[ja:言語]]
[[pt:Edição da língua]]
[[zh:语言]]
[[sk:Jazyk]]

Latest revision as of 00:15, 3 May 2011

Note: Language editing has been improved in Moodle 2.0 onwards. See Language customization for details.


Location: Administration > Language > Language editing

Edit words or phrases

Edit words or phrases in Moodle 1.9.5

The language editing interface enables you to easily change any word or phrase used on the site. For example, you may want to change the word "Course" to "Area".

To edit a word or phrase:

  1. Access Administration > Language > Language editing.
  2. Click the "Edit words or phrases" link in the middle of the page.
  3. Choose a file to edit. You may need to search through a few files before finding the file containing the word you wish to change. The file moodle.php contains all common site-wide phrases.
  4. Change the word or phrase.
  5. Click the "Save changes" button. The changed phrase will be highlighted in a different color.

Note: In versions of Moodle prior to 1.9, it is necessary to click the "Switch lang directory" button on the edit words or phrases page. A local language folder, parentlanguage_local, will then be automatically created in moodledata/lang. Files of edited strings will then be saved in this folder. This is necessary to prevent changes that you make being overwritten by a newer language pack when updating. In Moodle 1.9 onwards, the option to switch is no longer provided as edited strings are automatically saved in the local language folder.

If you wish to make further changes later, be sure to check that files of edited strings will again be saved to the folder parentlanguage_local, switching folder if necessary.

Changes in 1.9

Language pack maintaining in Moodle 1.9

Moodle1.9

  • From Moodle 1.9 onwards, only users with the capability moodle/site:langeditmaster may modify the master language packages (i.e. those being saved in moodledata/lang/). By default, the admin role has this capability set to "prevent". It is expected that only language maintainers will manually allow this for themselves. Language pack maintainers have an additional "Language pack maintaining" tab.
  • From Moodle 1.9 onwards, only users with the capability moodle/site:langeditlocal may customize the site translation (i.e. files being saved in moodledata/lang_local/). Admins are allowed to do this by default.
  • Added ability to edit language files in non-standard locations, i.e. string files for various types of plugin (e.g. blocks, database presets, 3rd party modules etc.)

See also

Using Moodle forum discussions: