hugo/langs/i18n
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.go langs/i18n: Revise the plural implementation 2021-04-23 07:39:59 +02:00
i18n_test.go langs/i18n: Revise the plural implementation 2021-04-23 07:39:59 +02:00
translationProvider.go langs/i18n: Support translation files with suffix *.yml 2021-02-06 18:12:54 +01:00