Skip to content

robertweiss/ProcessTranslatePage

Repository files navigation

ProcessTranslatePage – A Processwire Module for Effortless Page Translation

Welcome to ProcessTranslatePage! This module is designed to help you translate all text fields on a page in Processwire with ease.

As translations might take some time to proceed, PHP timeouts might occur on pages with a lot of fields and/or text. To bypass that, please refer to the section Command line usage

Updating from 0.X to 1.0

With the release of version 1.0, ProcessTranslatePage now connects directly to DeepL for translations, eliminating the need for the Fluency module. After updating, enter your existing Fluency API key in the settings and ensure you add locales for each language on their respective edit pages.

Installation

  1. Download and install ProcessTranslatePage.
  2. Configure your DeepL API credentials and adjust the module settings as needed.
  3. Add locale information to your source and target language pages. You can find supported locales here: https://developers.deepl.com/docs/getting-started/supported-languages. If you wish to use glossaries, please add the relevant information to each language page. Note that the Free API plan supports only one multilanguage glossary.
  4. Assign the ›translate‹ permission to your user role.
  5. Open a page, click the arrow next to the save button, and select ›Save + Translate‹ to begin translating.

Settings

  • DeepL API Key
  • DeepL Glossary ID (automatically set when using the glossary field in a language page)
  • Source Language
  • Exclude Templates
  • Exclude Fields
  • Exclude Target Languages
  • Show Single Target Language Buttons
  • Write Mode
    • Translate only if target field is empty
    • Translate only changed fields
    • Overwrite all target fields

Please note: The ›Changed fields‹ option currently supports only one level deep. If you modify any value inside a Repeater(-Matrix) or FieldsetPage field, the entire field will be translated.

Field support

  • PageTitleLanguage
  • TextLanguage
  • TextareaLanguage
  • File (and image) descriptions
  • Combo (ProField)
  • RockPageBuilder (3rd party)
  • All the mentioned fields inside Repeater, RepeaterMatrix, FieldsetPage, Functional and Table fields (ProFields)

Batch Translation with ListerPro

For translating multiple pages simultaneously, you can use the included ListerPro Page Action. This allows you to batch translate pages directly from the admin interface.

Prerequisites: ListerPro is a (highly recommended) commercial ProcessWire module that must be purchased first from https://processwire.com/store/lister-pro/

Installation: The PageActionTranslatePage module needs to be installed separately. After installing ProcessTranslatePage, install the PageActionTranslatePage module and assign the page-action-translate-page permission to your user role.

Usage: Create a ListerPro list, add the Translate Page Action to your allowed actions, select the pages you want to translate, and use the "Translate Page" action to batch translate all selected pages.

Command line usage

For translating multiple pages simultaneously and avoiding timeouts, you can also use the included script translate-pagetree.php from the command line. Before running the script, please update the variables $username, $home, and $includeHidden to suit your requirements.

Kindly note that this is a beta release. Although it is successfully used in production for several of my clients, I recommend thorough testing before deploying it in your projects. If you encounter any bugs, please consider creating a GitHub issue to help me improve.

About

Processwire module to translate all page fields via DeepL

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages