Some Wikimedia projects subdomains and (rarely) MediaWiki language codes are not aligned to CLDR's. The standardisation is ongoing but it will take time; in the meanwhile we sometimes need to intersect the two sets of language codes to avoid false negatives, for instance in https://bugzilla.wikimedia.org/57133 we look for "fil" based on CLDR data in a set that only contains "tl" based on MediaWiki locales.
It seems to me that the CLDR feature we need to use as workaround is the list of aliases: http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/aliases.html
Most of our special language codes are not in contradiction, but several are missing: https://meta.wikimedia.org/wiki/Special_language_codes
be-x-old -> be-tarask
roa-rup -> rup
zh-classical -> lzh
zh-min-nan -> nan
zh-yue -> yue
bat-smg -> sgs
cbk-zam -> cbk
fiu-vro -> vro
nds-nl -> nds
Add also this conflicting usage:
roa-tara -> it-x-tara (or register the tarandine variant subtag and use "it-tarandine")
it conflicts in the code space reserved for script codes (4 letter subtag "tara" could likely be used for some old South Asian scripts used in Thailand or Vietnam)
The two comments above are unrelated to this request. The alias list doesn't contain any redirect to BCP47 subtags, file a separate request if you want such a change.
FWIW: I have started hacking together a mapper in http://unicode.org/cldr/trac/browser/branches/srl/99uli7794/java/org/unicode/cldr/tool/LocaleMapperTool.java?rev=10838 for use. Here are some files I've mapped: http://unicode.org/uli/trac/browser/trunk/abbrs/xls_dbpedia/README?rev=57#L13
I think there are 2 reasons not to do this.
This appears to have fairly narrow usage, basically just Wikipedia. An important client, to be sure, but they can solve it themselves with a custom map.
2. It appears to me that we can't really supply a full solution for Wikipedia, because some of the codes collide. That is, the language aliases are set up to always map from X to Y, where X and Y "mean" the same thing. But codes like "als" used in Wikipedia are valid in ISO (thus in CLDR)—they are just used in Wikipedia to mean a different code.
If you disagree, please reopen and comment.