Reduce binary size vs locale, update to CLDR v36.1

Test building with `go build -ldflags="-s -w"`

Hugo 0.86.2: 46MB
Before this commit: 77MB
After this commit: 54MB

Fixes #8839
Fixes #8841
This commit is contained in:
Bjørn Erik Pedersen
2021-08-02 16:24:04 +02:00
parent 9a7383caf3
commit 3a96655592
10 changed files with 28 additions and 17 deletions

View File

@@ -20,8 +20,8 @@ import (
"strconv"
"strings"
translators "github.com/bep/gotranslators"
"github.com/go-playground/locales"
translators "github.com/gohugoio/localescompressed"
"github.com/gohugoio/locales"
"github.com/pkg/errors"
"github.com/gohugoio/hugo/deps"
@@ -186,7 +186,7 @@ func (ns *Namespace) FormatNumberCustom(precision, number interface{}, options .
exp := math.Pow(10.0, float64(prec))
r := math.Round(n*exp) / exp
// Logic from MIT Licensed github.com/go-playground/locales/
// Logic from MIT Licensed github.com/gohugoio/locales/
// Original Copyright (c) 2016 Go Playground
s := strconv.FormatFloat(math.Abs(r), 'f', prec, 64)