improve error when currency_code is not defined
allow trailing separator in locale