add line numbers support.

adopted [patch](https://sourceforge.net/p/smarty-gettext/patches/3/) from old project