Test Repo: https://bitbucket.org/MunifTanjim/hugo-test
Hugo Version: v0.29
OS: Ubuntu 16.04
baseURL = "http://example.org/"
title = "Hugo Test Site"
[languages.en]
lang = "en"
[languages.fr]
lang = "fr"
[languages.pl]
lang = "pl"
[test]
one = "test en {{ .Count }}"
other = "test en {{ .Count }}"
[test]
one = "test pl {{ .Count }}"
other = "test pl {{ .Count }}"
<!DOCTYPE html>
<html>
<head>
<title>{{ .Site.Title }}</title>
</head>
<body>
<p>{{ i18n "test" 1 }}</p>
<p>{{ i18n "test" 2 }}</p>
</body>
</html>
test en 1
test en 2
test pl 1
test
As you can see, the plural (i.e. other part of the i18n file) translation is not being detected when the language code is pl. But it works for any other language code.
I've reproduced the same bug with Hugo v0.28 & v0.27 too. Didn't tried with older versions than those though.
It is probably a duplicate of a related issue ... somewhere. There is a fix in the works, but no-one has taken the time to "do it".
Polish's plural form has 4 categories (one, few, many and other) according to the Unicode spec, which seems referenced by go-i18n. So, pl.toml should have 4 entires like below.
[test]
one = "test pl {{ .Count }}"
few = "test pl {{ .Count }}"
many = "test pl {{ .Count }}"
other = "test pl {{ .Count }}"
Probably we can show more user-friendly message?
Okay, this is not a bug.
Perhaps this issue should be closed.
Most helpful comment
Polish's plural form has 4 categories (one, few, many and other) according to the Unicode spec, which seems referenced by go-i18n. So,
pl.tomlshould have 4 entires like below.Probably we can show more user-friendly message?