Abstract language system's path handling
Drupal's localization system implements URL, path, and domain based context-management functionality (toggled using the variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) switch). This code overlaps with (and conflicts with) Domain Access module, PURL module, and a number of other third-party tools for building large sites.
The tools implemented in the language system allow the following elements of the URL to control the site's current language:
- Top level domain: http://www.mysite.com vs. http://www.mysite.es, or http://spanish.mysite.com vs. http://english.mysite.com
- Path suffix: http://www.mysite.com/en vs. http://www.mysite.com/es
- Fallback value: A default language to be used in the event that no language-mapped domain or path element exists
This is both limiting for the language system (different sections inside the same site cannot easily be mapped to other languages), and collides with modules like Domain Access that use the same path information to control other contextual data (active OG, for example).
In addition, there's conceptual overlap with the Block.module based path/role/php visibility management. Both should be moved to a central location and any module should be able to use them.
