Fixed #24063 -- Locale code validation too strict

The locale code can contain variant after @, so let's allow the
validation of it to pass.