Remove unused imports
Cosmetic comment updates
Install a fake gettext function if setlocale() failed
Use local variable that is available