Overriding installed language standard strings via code?

Overriding installed language standard strings via code?

by Amir Elion -
Number of replies: 4

Hi all,

We have a situation in which we want to change specific standard lang strings in non-EN language on several servers different installations. Using local lang on moodledata means that we need to copy that every time we create a new server instance.

We tried to add a corresponding lang folder and the strings in it in the code itself (e.g under moodle code lang folder add "es" folder with the specific strings), but the language install on Moodle data seems to override that.

Is there a way to make Moodle use the code strings instead or must we copy the local lang folder on every instance?

Thanks,

Amir

Average of ratings: -
In reply to Amir Elion

Re: Overriding installed language standard strings via code?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

"must we copy the local lang folder on every instance?"

I'm afraid that is your only "reasonable" option. But let's wait and see if other moodlers on this forum come up with other solutions.

In reply to Amir Elion

Re: Overriding installed language standard strings via code?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We do this at the OU. There are some things you can set in config.php like $CFG->locallangroot, which you can point at a different folder than moodledata/lang. Hopefully this is documented in config-dist.php. If not, let me know and I will try to remember to copy the chunk you need from on of our config.php files later.

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Overriding installed language standard strings via code?

by Amir Elion -

Hi Tim,

Thanks for the reply.

I could not find it in the config-dist. It would be great if you could assist.

Thanks,

Amir

In reply to Amir Elion

Re: Overriding installed language standard strings via code?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think you just need

$CFG->langlocalroot    = '/fs1/www_root/tjh238/vle/lang';
$CFG->langotherroot    = '/fs1/www_root/tjh238/vle/lang';
$CFG->skiplangupgrade  = true;

(where '/fs1/www_root/tjh238/vle' is $CFG->dirroot.)

Average of ratings: Useful (2)