fix detection of locales directory registration