Author Archives: meloniq

GP Restrict Subscribers Suggest

GlotPress plugin to restrict subscribers from suggesting translations.

If a subscriber has additional permissions — for example, if they are a validator for a specific locale — they will still be able to add translations for that locale, but not for others.

This applies to situations where your site has users with subscriber roles for other purposes, such as receiving newsletters, posting comments, or purchasing products, and you simply don’t want them to have the ability to interfere with GlotPress, the translations system.

Repository: https://github.com/meloniq/gp-restrict-subscribers-suggest

GP Translation Updater

Plugin extends WordPress updates mechanism, and when WordPress checks for a plugins or themes updates, the Updater also check for that updates in configured custom GlotPress instance, and let’s the WordPress knows when an update is available.

Extra headers:

GlotPress API URI: this is the URL to our GlotPress, eg: https://glotpress.local/

GlotPress API Path: this is the path to our project, eg: appthemes/clipper/2.0.x

Plugin: add extra headers to main plugin file, eg. wp-plugin.php

/*
Plugin Name: My Plugin
Version: 1.2.3
GlotPress API URI: https://glotpress.local/
GlotPress API Path: mycompany/myplugin/1.2.x
*/

Theme: add extra headers to style.css

/*
Theme Name: My Theme
Version: 2.5.0
GlotPress API URI: https://glotpress.local/
GlotPress API Path: mycompany/mytheme/2.x
*/

[GlotPress] Automatic Translation Updates

Automatic Translation Updates with GlotPress

Managing translations for commercial WordPress plugins and themes outside the official repository can quickly become a hassle. Each time a translator makes a change, you need to manually download updated files from GlotPress, rename them, and upload them to your server. To streamline this process, you can connect GlotPress directly with WordPress using the GP Translate Update API and GP Translation Updater plugins. This setup allows WordPress to automatically check for and install new translation updates—just like it does for core, plugins, and themes.

Scenario:

  • We have our commercial plugin/theme which is not listed in the official WordPress repository
  • We have our own GlotPress environment to manage translations of our plugin/theme

Problem:

  • We have to track when the new translations are available, when one of the translators made some changes
  • We have to download translation files manually, rename them, and upload to the server each time a new version is available

Solution:

  • Installing GP Translate Update API plugin on our GlotPress instance
  • Installing GP Translation Updater plugin on our WordPress site
  • Adding “GlotPress API URI” and “GlotPress API Path” headers to our commercial plugin/theme

More in depth:

GP Translate Update API plugin adds a REST API endpoint that serve information about the translation updates. It requires GlotPress and GP Format ZIP plugins installed.

GP Format ZIP plugin adds support for ZIP archive file to GlotPress, so we can download a bundle containing PO, MO, and PHP files.

GP Translation Updater plugin extends WordPress updates mechanism, and when WordPress checks for a plugins or themes updates, our Updater also check for that updates in our GlotPress instance, and let’s the WordPress knows when an update is available.

Extra headers:

GlotPress API URI: this is the URL to our GlotPress, eg: https://glotpress.local/

GlotPress API Path: this is the path to our project, eg: appthemes/clipper/2.0.x

Plugin: add extra headers to main plugin file, eg. wp-plugin.php

/*
Plugin Name: My Plugin
Version: 1.2.3
GlotPress API URI: https://glotpress.local/
GlotPress API Path: mycompany/myplugin/1.2.x
*/

Theme: add extra headers to style.css

/*
Theme Name: My Theme
Version: 2.5.0
GlotPress API URI: https://glotpress.local/
GlotPress API Path: mycompany/mytheme/2.x
*/