xgettext

xgettext with keyword that contains special characters


How can keywords be escaped when passing the --keyword argument? We use static calls to fetch translations, i.e. in the form Language::getText('foo');


Solution

  • I’m afraid you only have three options:

    1. Write your own custom tool to extract strings from this sort of code.
    2. Realize you are using a gettext library that has certain ways of doing thing and use it as it was intended to be used, i.e. with some sane, simple function or macro instead of a verbose Language::getText method call.
    3. Add support for this to xgettext and submit a patch to GNU gettext project.