symfony/symfony — Issue #2468: Symfony language code mangling makes it hard to reuse
Author: goba
Created: 2011-10-25 11:34:32+00:00
State: open

Symfony mangles language codes for its internal use to (a) uppercase all components but the first and (b) replace component separating dashes with underscores. This is maybe conforming to a standard or common practice, but the W3C never suggested people use language codes like that and their recent recommendations with HTML5 are clearly very far from how Symfony treats language codes.

There is certainly nothing wrong with picking a language code format and doing conversion on incoming data and outgoing data. We in Drupal try to avoid this by using a standard that is much closer to the W3C specs. We use all lowercase codes (which is not strictly W3C) and we use dashes (like the W3C). Now that Drupal 8 is adapting Symfony in certain places, we cannot reuse the language handling code at all since the language codes are so far from how the web expects them, and we don't want to convert back and forth if we can work with formats that are exactly or at least much more closely resemble web standards.

More information on language codes on the web: http://www.w3.org/International/articles/language-tags/