added switches to change language mode and fix bugs counting space of the end of line