String override

General plugins (Local) ::: local_string_override
Maintained by Juho Jaakkola, Arto Nieminen
Makes it possible for plugins to override existing translations regardless if they're bundled with Moodle or they're originated from a community plugin.
Latest release:
17 sites
1 downloads
1 fans
Current versions available: 1

Moodle plugin that allows plugins to override existing translations.

Every now and then plugins need to change the way how Moodle behaves. Changes in the behavior may however cause the existing translations to become inconsistent with the new behavior. This plugin makes it possible for plugins to override the existing translations regardless if they're bundled with Moodle or they're originated from a community plugin.

Installation

  1. Place the plugin source code to /local/string_override/ directory
  2. Enable the string manager in config.php with:

    $CFG->customstringmanager = 'local_string_override_manager';

How to use it

  1. Find the identifier of the string that you want to override
    • E.g. auth_changepasswordhelp_expl
  2. Find out the file where the translation is located
    • E.g. /lang/en/auth.php
  3. Create the file <type>/<your_plugin>/lang/<lang_code>/<translation_file>.php
    • E.g. local/lazydog/lang/en/auth.php
  4. Add the string identifier to the file using the standard translation file syntax

    $string['auth_changepasswordhelp_expl'] = 'Your custom translation here';


Screenshots

Screenshot #0

Contributors

Juho Jaakkola (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Plugins bot
    බ්‍රහස්, 11 අගෝ 2016, 3:31 PM
  • David Mudrák
    සිකු, 19 අගෝ 2016, 7:34 PM

    Thanks Juho for following up on our discussion at https://tracker.moodle.org/browse/MDL-46582 and for sharing this plugin with the community. I am happy to approve it now. You are cleared to land, welcome to the Plugins directory!

  • Raúl Garoña
    බ්‍රහස්, 6 ජූලි 2017, 5:31 PM
    Thanks Juno for the plugin. I've made it work for a core string, but I can't make it work for a string of the quiz module (quiz/accessrule/timelimit/lang/en/quizaccess_timelimit.php), my string override path is local/contact/lang/en/quizaccess_timelimit.php
    Can you help me?
    Thank you very much.
  • Juho Jaakkola
    බ්‍රහස්, 6 ජූලි 2017, 8:21 PM
    I tried it and it won't work for me either. I think the problem is that the quizaccess_timelimit is a sub-plugin for the quiz plugin. My plugin doesn't yet support such use case. I'm not completely sure what kind of changes would be required in order to add the support.
  • Juho Jaakkola
    බ්‍රහස්, 6 ජූලි 2017, 10:07 PM
    I made a quick attempt to add support for sumodules, but the problem is that the script runs out of memory. You can take a look at it in the 'submodule_support' branch at Github: https://github.com/mediamaisteri/moodle-local_string_override/tree/submodule_support
Please login to post comments