Translation of custom modules and themes in Drupal 7
As we discussed a lot about translation in the previous posts Translation in Drupal 7 : How it works? and TRANSLATION in Drupal 7 : How to work with, let us discuss few points about how to do custom translation to our module and pot(.po) file handling for string translations. Before getting into the custom translation let us know few things about pot file handling. The pot (or) potx file which will be with extension .po. This pot(.po) file can manually be created or this can be generated with the help of the drupal module called Translation template extractor.
Let us see, how to generate the pot file for translation. First we need to enable the Translation Template Extractor module. Once the module is enabled, you will be seeing the “Extract” tab in the TRANSLATE INTERFACE section under REGIONAL AND LANGUAGE.
Now create a custom module and build all your required functionalities in the module and before enabling it, now go to the Extract Tab in Translation Interface, there you can find you module listed under Directory "sites/all/modules".