FAQ: Can I write a plugin that interacts with Loco Translate?
Yes. Developers are free to develop plugins that work when Loco Translate is installed.
You can call any of our plugin's functions, but it's recommended to only use hooks. We're unlikely to remove or change existing hooks, but any other part of our code base could change at any time. That includes the available PHP, HTML, CSS and JavaScript that make up the plugin, so rely on these at your own risk.
Adding auto-translation services
Loco Translate provides a hookable way to add your own translation APIs into our various integration points. This is currently the only hookable API we purposefully provide.
- Here's an example of a Mock Translator API for generating dummy text for debugging.
- Here's an example that integrates the IBM Translator API, which isn't included in the main plugin.
See the code in these examples to understand the hooks. There is currently no other documentation, but it is quite simple.
Modifying Loco Translate
We're not aware of any other use-case where developers are creating "add-ons" for Loco Translate, but there are plenty of possibilities and we hope to add more hooks in future to help with that.
If you plan to create a plugin that interacts with our code, or injects itself into our admin pages - whatever it does - please consider whether your plugin modifies the experience of using Loco Translate, and whether your modifications are in good faith.
Developers are free to change the behaviour of Loco Translate by hook or by crook, but we ask kindly that you're respectful of our hard work and don't create more work for us. We cannot enforce any of the following points, but we will take steps to obstruct behaviour that we feel is damaging to our plugin, our users, or our business.
Be respectful of our brand
Please don't use the word "Loco" to imply that your product was developed by us. This is in line with the WordPress guidelines on using other product names. "My widget for Loco Translate" is fine, but "Loco Translate widget" is not. This extends to any external website you develop to promote your plugin.
Our logo is that which you see in the top-left corner of this page. Please don't use this in any of your branding unless you're in partnership with us and we've given permission.
Be respectful of our admin pages
Any plugin can modify the admin pages of any other plugin. This is what WordPress hooks are designed for and they can be used for good or evil. Please avoid the latter.
The Loco Translate admin pages are the visual presentation of our plugin to our users. Modifying the interface is strongly discouraged, and we would prefer you add functionality to your own admin pages rather than ours. We work hard to ensure our pages are usable and free of bugs. Making UI or script changes can easily cause problems without your realising.
Removing access to our services or splashing your own branding on our pages is considered foul play. We will act to make this harder if we identify any plugins behaving this way.
Don't break our code
We test our code thoroughly because it's installed on over a million servers, or so they tell us. That's a lot of responsibility for us to avoid shipping bugs, and it carries a huge support burden when things go wrong for people.
If your plugin causes mysterious errors in our admin pages it will be our inbox that fills up with complaints. Worse still, we will be unaware of the cause and unable to fix the problem. When we discover that another plugin conflicts with our code, we change our code to keep it working. This may result in the conflicting plugin no longer working. It's a two-way street.
Support your own users
If someone is using your plugin then they're also using our plugin. For this reason we're obliged to support them when they run into trouble and this is a lot of work. Please bear this in mind when you release a plugin that requires support. Problems will mostly come to us and often without any mention that your plugin is installed.
Make it clear which functions you're responsible for supporting, and which are in our domain. As per the previous point, avoid the situation where a bug in your code is perceived as a bug in ours.
Don't charge for our services
Loco Translate is free, and so is the support. We take a dim view of anyone charging money for access to the same features that we provide. This is unfair to our users and extremely damaging to our reputation when customers decide they want their money back, but wrongly assumed they bought your product from us.
It may be perfectly legal for you to charge for a product that relies on Loco Translate. The GNU Public License may allow it, and WordPress may allow it. But if you're going to charge for an extension or modification of our plugin, make sure you're adding something we don't provide. For example, IBM (if they wished) could release a plugin just like our example and charge you for using their API from within Loco Translate.