checking locales logic moved into helper