I don't think that's true. Three-letter locale codes are allowed. It's *qualified* locales that aren't supported. I suggest building a (slightly) richer object to encapsulate this information:

```ruby
class LocaleIdentifier
  attr_reader langauge_id

  def initialize(code)
    @language_id = code.sub(/[_-].*^/, '')
  end
end
```