twitter/twitter-cldr-js — pull request #34 by KL-7 (2014-06-24 23:41:52+00:00)
Title: Translate language codes into language names only in current locale.

This pull request removes the ability to translate language codes into language names in any locale other than the locale of the JS bundle itself, but at the same time it reduces the size of the bundles on average by more than 500K (from ~700K to under 200K). It's unfortunate that I had to remove some of the functionality, but embedding the data for all language codes and all locales into each bundle is too expensive (it's almost 600K of JSON data).

Sorry for reverting some of your work, @radzinzki, but the size of the JS bundles is a critical factor (at least when used in a browser rather than on the server-side via node), so as a general rule, I think JS bundles should contain data related only to their locale. Also, as we add features, we should keep track of the size growth of the generated JS files.

Probably we can revisit this feature when (and if) we get to separating the implementation from the data. When that's done, we can have implementation that can translate language codes into language names in all locales that are loaded. In that case it'll be up to the users to decide what locales they want to support and if the size of the data required for that is acceptable for them.