How to use a lang file in my plugin?
#1
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
Reply
#2
This is simple:
function myportfolio_info() {
   global $lang;
   $lang->load('myportfolio');
    return array(
        'name' => 'MyPortfolio',
        'description' => $lang->description,
);
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#3
Thank you so much Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)