When the locale is missing, an empty string is returned which does not evaluate to false, so the test doesn't pass with this change.