I have hundreds of strings in my code-base that which translation i.e. strings inside t() function.

Is there a script that can traverse through my code-base and collect all the strings and export them to an excel file?

Or else, Is there any other way?


By default, every string you wrap in the t() function is going to be added to the localization database by the core Drupal locale module as soon as Drupal encounters the occurrence. You can then use the translation interface to search for these new strings and update them manually or export a Gettext Portable Object Template file


These files are in text format and easily editable by non-technical users, ex:

#: misc/tabledrag.js
msgid "Hide row weights"
msgstr ""

There are a number of tools available for working with gettext files, I would recommend the Localization client module for doing this work within the Drupal interface. There is also an option to convert these files to excel and back using csv2po but I haven't used this:


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.