Jump to content

Recommended Posts

Posted

Hi everyone,

I'd like to share a small module for module developers who ship their modules with language files: LanguageCSVExporter.

The problem
ProcessWire's translation tools are great for translating one file at a time. But if you want to ship your module with a language pack, you have to collect the translations of all its files by hand. Most modules have many files (fieldtypes, inputfields, helper classes, …).

What the module does
It adds a page under Setup > Language CSV Exporter. Select a module and a language, click Download translations as CSV, and you get one CSV file with all translations of that module, e.g. FrontendForms-de-translations.csv. You can put the file straight into the languages/ folder of your module, and ProcessWire offers it for installation ("install translations") on the module info page.

Features

  • Uses ProcessWire's own LanguagePorter, so the CSV rows are byte-identical to the core export and can be imported again as usual
  • Separates modules that share one folder: a main module and a companion module (e.g. FrontendForms and FrontendFormsManager), modules in subfolders, and renamed folders like Name-main from a GitHub download
  • Also exports translation files copied by RockLanguage that are not listed on the language page
  • No temporary files: the CSV is created in memory and sent directly to the browser
  • Works in debug mode (PHP notices don't end up in the CSV)
  • Own permission (language-csv-exporter) to control who may export
  • All texts translatable, German translation included
  • Unit tests (PHPUnit) and WireTests included

Requirements
ProcessWire 3.0.264+ (for LanguagePorter), LanguageSupport, PHP 7.2+

Download
https://github.com/juergenweb/LanguageCSVExporter

Feedback and bug reports are welcome!

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...