The TRANSLATOR Plugin is an extension for Grav CMS.
Installing the Mde plugin can be done in one of three ways: The GPM (Grav Package Manager) installation method lets you quickly install the plugin with a simple terminal command, the manual method lets you do so via a zip file, and the admin method lets you do so via the Admin Plugin.
GPM Installation (Preferred)
To install the plugin via the GPM, through your system's terminal (also called the command line), navigate to the root of your Grav-installation, and enter:
bin/gpm install translator
This will install the Mde plugin into your
/user/plugins directory within Grav. Its files can be found under
To install the plugin manually, download the zip-version of this repository and unzip it under
/your/site/grav/user/plugins. Then rename the folder to
mde. You can find these files on GitHub or via GetGrav.org.
You should now have all the plugin files under
NOTE: This plugin requires the Email Plugin for Grav if you are not using the Slack notifications.
If you use the Admin Plugin, you can install the plugin directly by browsing the
Plugins-menu and clicking on the
Before configuring this plugin, you should copy the
user/config/plugins/translator.yaml and only edit that copy.
Here is the default configuration and an explanation of available options:
enabled: true base_route: '/translator' # The plugin will operate under this route for all functionality. fields: # Which fields the plugin allows for translation, every other field is ignored - text - textarea - editor - ckeditor - markdown slack: enabled: false # Enable slack notifications webhook: '' # The webhook URL - generate your own via slack developer app channel: '#general' # The channel in which to send the message style: color: '#39CCCC' # Teal logo: user/plugins/translator/images/grav-logo.png: name: grav-logo.png type: image/png size: 14215 path: user/plugins/translator/images/grav-logo.png
Note that if you use the Admin Plugin, a file with your configuration named translator.yaml will be saved in the
user/config/plugins/-folder once the configuration is saved in the Admin.
The plugin has a few simple requirements.
1. For best use of the plugin, blueprints are recommended.
The plugin uses blueprints to determine which fields should appear or not in the translation area. By default, all text, textarea, editor, fields will automatically be enabled. However, you can enable or disable specific types by adding a
translator: true or
translator: false key to a field. For example:
Lets say we have the following field:
header.id: type: text label: My Personal ID
This is a field that we dont want to allow for translation, so we can make the plugin skip this field by adding
header.id: type: text label: My Personal ID translator: false
2. For a
translator to be allowed access into the translator area they require 2 things added to their user account:
access: site: translator: 'true'
Any admin with
super: true access will also be able to enter the translators area. However, before you can edit any language, you must first tell the plugin which language each user is allowed to translate. This can be done by adding the following:
translator: - de - en - es - sv
You can add as many languages as you want (as long as you have already enabled them in your multi-lang site).
You may also enable ALL enabled languages to be given access by simply adding:
translator: - super
You are now ready to start translating!
HOW TO ENABLE SLACK NOTIFICATIONS
Go to SLACK API and sign in your with Slack account. Make sure you are on the correct workspace too!
Add New Webhook to Workspacebutton at the bottom of the page. Select the channel you wish to send messages to. Your end result should be something like this:
Now copy the webhook url and the channel to the plugin configurations as shown above:
slack: enabled: true webhook: 'https://hooks.slack.com/services/...' channel: '#test'
Click Interactive Components on the sidebar menu and turn
Request URLas follows:
yourwebsite.com with the domain you are using the plugin on, and replace the
/translator ONLY if you have modified the default
Now you can enable Slack notifications in your plugin for approving and denying translator submitted pages.