add unit test for LocaleListener
cs
move locale determination to a separate method

This piece of code is likely to be overriden in child classes with a
custom logic.