Search code examples
drupal-7translation

Drupal 7 - How to add custom translation text group for strings on a theme


I have in my Drupal 7 some templates translated by echo t("xyz"). I can find all the strings in the translation administration interface, but the strings are mixed with all the default drupal strings.

I would like to search for just my own strings or strings that belong to a specific template (theme). Available filter options (not helping me):

  • All text groups
  • Build in intarface
  • Node tyles
  • Meta tag
  • Menus
  • Blocks

Solution

  • You have to define your own own "Text Group" using hook_locale() function. Furthermore i18n module provides some more options.

    An easy method would be to create the custom "Text Group" and then create a .po file with your translation strings and finally import it on the specific text group (admin/config/regional/translate/import).

    Related question here: https://drupal.stackexchange.com/questions/29125/use-a-custom-textgroup-from-t