Ignore duplicate locales

Can you make this more DRY by making just one function `processLangMap` that will inspect at the langMap variable to see if it's an array or object and act accordingly?