1

I have a custom module. In this module all strings are in English. However, my website is in French and when installing the custom module, I'd like the French strings to be picked up and imported automatically.

What's the best way to generate and then package the .fr.po translation file with my custom module?

(With D7, I would use potx to generate the .po file for my module, then I'd put the file under sites/all/modules/custom/MYMODULE/translations. But potx no longer exists for D8 and the d.org documentation isn't very helpful.)

1

potx itself isn't directly available as a Drupal 8 module, but it doesn't need to.

It also works as a drush extension and can be run on Drupal 8 code. Haven't tried it if providing a translations folder still works, but I think so.

So, still works pretty much the same as in Drupal 7.

  • Thanks, Berdir. Do you know if I need to have the D7 potx module in my D8 installation for potx to work as a drush extension? – AngularChef Aug 3 '16 at 6:22
  • Just put the files into $HOME/.drush, where other drush configuration files are too. drush dl potx might just do that automatically. – Berdir Aug 3 '16 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.