MyBB Community Forums

Full Version: Find & Replace
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to use fine & replace to edit a language file using a plugin ?

File i want to edit :
ACP >> Configuration >> Languages >> English >> global.lang.php
It's better to ship your own language file with a plugin than edit existing ones.
But i need to edit an existing language file "global.lang.php" , as part of my plugin.
(2010-09-19, 03:54 PM)Janota Wrote: [ -> ]But i need to edit an existing language file "global.lang.php" , as part of my plugin.

No you don't Smile
Simply make a new lang file:
plugin_<plugin_name>.lang.php
In that plugin file create the edited version of whatever lang item you need.
Then load that plugin lang file AFTER you load global.lang.php inside your plugin.
Can you show me a quick example ? Im kinda grasping what your.

How to load both files?
Simply include two lang loads lol

misc.php from MyBB has 4 in a row.
misc.php:152:	$lang->load("helpdocs");
misc.php:153:	$lang->load("helpsections");
misc.php:154:	$lang->load("customhelpdocs");
misc.php:155:	$lang->load("customhelpsections");
Hmmm,

Ok for example, lets say i wanted to change the first line of code in
Quote:inc/languages/english/global.lang.php

First line is:
Quote:$l['redirect_width'] = "50%";

So apon activating my plugin how would i change that line of code to:
Quote:$l['redirect_width'] = "100%";

?



As I said, make a new lang file and put that in there Wink
Then load that lang file after you load global.lang
Im just not to sure what you mean , ill do some research , ty
file plugin_plugname.lang.php (which goes in inc/languages/<lang>/)
$l['redirect_width'] = "100%";

Inside your plugin where you want to use the new redirect_width (place these just after your global $lang call):
$lang->load("global"); // Should already be loaded... but better safe than sorry.
$lang->load("plugin_plugname");