Trivial refactors for gettextutils

* Favor one-line conditional assignments instead of more verbose
  assignments inside if...else clauses

* Favor the usage of generators instead of explicit for loops for
  perfomance

Change-Id: Idfbbec7cd2efa1ebbf5111abb24cb147edb176ee