Generate .pot files of custom modules in Drupal

Since I developed my own modules in Drupal, now it’s time to translate them into Thai. In order to translate custom modules, I need to generate .pot files from all PHP codes. Drupal provides extractor.php in the translation templates or you may directly get it from CVS. Note that you need PHP command line interface to run extractor.php. In Ubuntu, you can install php4-cli or php5-cli which match to your installation. To generate .pot files, follow below instruction.

  1. Change working directory to your module
    cd ~/httpdocs/modules/mymodule
  2. Run extractor.php
    php ~/contributions/translations/drupal-pot/extractor.php

That’s all! You might see new files in pattern mymodule-module.pot.

Technorati Tags: , , , , , , , , , ,

Post new comment