One of the features that was requested by CiviCRM users was the ability to inherit the language selected in the CMS hosting the given CiviCRM instance – and I’m happy to report that CiviCRM just gained this functionality (for Joomla!-hosted CiviCRM installs).
Internally, CiviCRM standarised on the common xx_YY locale abbreviations, where the lowercase xx part denotes the given language’s ISO code, while the uppercase YY part denotes the ISO code of the country the given dialect of the language is spoken. Thus, our default en_US means American English, while en_GB means British English; similarily, pt_PT is Portuguese, while pt_BR is ‘Portuguese as spoken in Brazil’, i.e., Brazilian Portuguese. The case of my native tongue is even simpler – pl_PL is, technically, ‘Polish as spoken in Poland’ (but we don’t have any other ‘official’ Polish dialect).
When investigating how Joomla! stores its language setting I was happy to discover that the config singleton returned by JFactory::getConfig() can be asked nicely to getValue('config.language') – and all there’sleft to do is to replace the - with _ (as Joomla! keeps the locales in the xx-YY format).
Thus, the inheritance of the CMS’s language is now possible in CiviCRM – all this while still keeping the ablility for a user to stick to its own chosen CiviCRM language if they so prefer. :)