MyBB Community Forums

Full Version: How to use a lang file in my plugin?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

I'm creating my first plugin, so I have noob questions Blush

I want to add something like

function myportfolio_info() {
	return array(
		'name' => 'MyPortfolio',
		'description' => '$description',
);

Just to put an example, I know that it is not finished and that $description is not going to work.

So, I'd like to create a file called myportfolio.lang.php and add it to my english language folder, and then how could I load a variable from there? like $l['description'] = 'This should be the plugin description';

I hope you guys understand me Big Grin

Thanks for your time
This is simple:
function myportfolio_info() {
   global $lang;
   $lang->load('myportfolio');
    return array(
        'name' => 'MyPortfolio',
        'description' => $lang->description,
);
Thank you so much Big Grin