How to edit plugins code?

Hi.

I’ve installed this plugin with this tutorial and I want to edit it because this plugin is in english and my forum is in french.

Where the plugins files are located?

Thanks!

It’s best to do a PR with your new locale on the repository :wink:

3 Likes

EDIT: Found what PR mean.

Yes, I will probably contribute, but I need to access to the code to make it work like I want, like, ban other sorts of login and only use this plugin to log in my Discourse

Just disable local logins in the Discourse settings.

1 Like

Didn’t think of that… Thanks a lot!

I will also like to add more features, like auto update of profile pics and usernames to this plugin (and even contribute to the original plugin, but use it and test it directly in my forum, without the validation of the author).

Since you’ve installed the plugin, you already know where the repository with the code is (here). To modify it, you fork that repository (you will need a github account). The forked repository is yours so you can edit away. When you’re done, you create a PR for the modified/added code.

2 Likes

Thanks!

So, logically, when I install plugins on my Discourse, they are not stored in my VPS?

The build will pull a copy down to your instance, so yes they are stored, and you will need to keep them up-to-date on the /admin/upgrade screen.

Christoph’s suggestion is a good one. Get a GitHub account, fork the plugin you like, create additional language text and once completely happy, submit a pull request to add it to the original project.

1 Like

Done.

Thanks for the advice!

I have a question that’s a bit of a reference.
If I want to install a theme that updates automatically, do I also have to add it to my own repo so that it does not update (I change it) ?
Do I have to change something in the code so that the update does not work for the theme?

1 Like

You’re going to be prompted periodically by the theme to apply updates. The simplest solution is don’t press the button.

If you fork then there’s a fair chance that Discourse updates will come along and break the site design completely if you’re using a theme which isn’t being updated. At that point you’re going to be stuck until you switch back to the original theme your design is based upon.

This topic is about plugins though, themes aren’t installed or updated in the same way as plugins any more - there’s a whole UI in /admin/customize to manage and configure themes and theme components.

3 Likes