Juergen Posted 15 hours ago Posted 15 hours ago 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! 2
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now