<p>An anonymous visitor to #openstreetmap on IRC pointed out that the slippymap contains a huge javascript file: assets/application-....js currently takes over 600 KB to download (gzipped), and expands to nearly 3 megabytes of Javascript.<br>
This may not be "that much", compared to other map services, and you won't notice it unless you have a slow connection (or worse, a slow computer), but it bugs me especially because I otherwise like the OSM slippymap for being relatively lightweight.</p>
<p>90% of that javascript file is an associative array of translations (of labels, UI elements, messages, and tag/value descriptions) in 120+ languages, about 20 KB for each language.<br>
Most clients will only ever use values from one or maybe two languages, the rest just puts unnecessary load on the network and browser.</p>
<p>Those translations could be put into separate files for each language (presumably that code is auto-generated anyway?), and the main script would then only have to download the one language that it actually plans to use on this client.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/openstreetmap-website/issues/1021">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLXKoYgRpEJba-8uicleQ5WTjHksAks5ojyetgaJpZM4FkcZt.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/openstreetmap/openstreetmap-website/issues/1021"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>