I have a need to create a Spanish site targeting a Latin American audience. It is my understanding that valid language code would be es-419 for this, but Drupal doesn't allow me to create this, instead it throws an error message:
Notice: Undefined index: langcode in language_admin_edit_form_validate() (line 365 of core/modules/language/language.admin.inc).
may only contain characters a-z, underscores, or hyphens.
The W3C page that is linked on the very same page where you can define a custom language even lists this language code as one of it's examples:
"es-419 Spanish as used in Latin America"
http://www.w3.org/International/articles/language-tags/
Other use cases for this is if you wish to create an English language site targeting a Middle Eastern audience, where (I think) it would make sense to use en-145 as language code:
http://schneegans.de/lv/?tags=en-145&format=text
Beta phase evaluation
Issue category | Bug because valid languages are not allowed |
---|---|
Unfrozen changes | Unfrozen because it is a bug in both Drupal 7 and Drupal 8 |