The latest code in the Arcavias Core and the Zend extensions already contains checks if the locale is valid, so you don't need to do it yourself