[openstreetmap-website] application.js contains huge list of translations (#1021)
dawidi
notifications at github.com
Mon Aug 3 09:11:09 UTC 2015
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.
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.
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.
Most clients will only ever use values from one or maybe two languages, the rest just puts unnecessary load on the network and browser.
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.
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/1021
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20150803/77561f22/attachment.html>
More information about the rails-dev
mailing list