Extract duplication in gettext theme tasks