Wruczek / ts-website

A website for your TeamSpeak 3 server
https://ts.wruczek.tech
GNU General Public License v3.0
333 stars 80 forks source link

change the exclude from dayjs #182

Closed xopez closed 3 years ago

xopez commented 3 years ago

Since en (https://raw.githubusercontent.com/cdnjs/cdnjs/master/ajax/libs/dayjs/1.10.4/locale/en.js) is available and en-us not (HTTP 404) we should just switch the condition. Also we should use the min.js files. The files are available for every locale file. It saves about a byte because the non minimized file has a linebreak (LF). Also some variables got replaced. It doesn't save much, but a little bit.

xopez commented 3 years ago

Diff of german locales: grafik

Wruczek commented 3 years ago

The if statement is correct. The language code used for locale file is different than the ts-website language code, and comes from DAYJS_LANG variable set in every language. The DAYJS_LANG for English (US) is actually just en, and it's the default language already bundled with day.js - that's why we don't need to load it. The DAYJS_LANG for English is en-gb, and we need to load it from the CDN.

xopez commented 3 years ago

My bad. I reverted te condition. I forgot to change that 2 lines in my database: https://github.com/Wruczek/ts-website/commit/c751001c6182caaacb0a4592f285a6878fd6d5ff#diff-7229ab00f5539e46dcb2d0c1c51fab463f201a3b09580b48f52216bedddfce22L80-R81

I changed my PR now. I also changed that in the table languages.