hugo/langs
Bjørn Erik Pedersen 537c905ec1 langs/i18n: Revise the plural implementation
There were some issues introduced with the plural counting when we upgraded from v1 to v2 of go-i18n.

This commit improves that situation given the following rules:

* A single integer argument is used as plural count and passed to the i18n template as a int type with a `.Count` method. The latter is to preserve compability with v1.
* Else the plural count is either fetched from the `Count`/`count` field/method/map or from the value itself.
* Any data type is accepted, if it can be converted to an integer, that value is used.

The above means that you can now do pass a single integer and both of the below will work:

```
{{ . }} minutes to read
{{ .Count }} minutes to read
```

Fixes #8454
Closes #7822
See https://github.com/gohugoio/hugoDocs/issues/1410
2021-04-23 07:39:59 +02:00
..
i18n langs/i18n: Revise the plural implementation 2021-04-23 07:39:59 +02:00
config.go all: Format code with gofumpt 2020-12-03 13:12:58 +01:00
language.go all: Fix minor typos 2020-12-16 12:11:32 +01:00
language_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00