Intro
I’m translating a theme and it seems to me I caught an issue.
I don’t understand why Hugo returns the name of a variable instead of reporting a problem if one exists.
Configs
Hugo
$> hugo version
Hugo Static Site Generator v0.50-DEV/extended linux/amd64 BuildDate: unknown
$> whereis hugo
hugo: /home/user/go/bin/hugo
$> go version
go version go1.11 linux/amd64
My config.toml
baseURL = "/"
languageCode = "en-us"
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true
enableMissingTranslationPlaceholders = true
copyright = "Everything is mine"
[languages]
[languages.en]
title = "EN"
weight = 1
[languages.ru]
title = "RU"
weight = 2
[languages.ru-RU]
title = "ru_RU"
weight = 2.5
[languages.ua]
title = "UA"
weight = 3
[languages.fr]
title = "FR"
weight = 4
The directory i18n
also has all translated.
en.yaml
- id: variable_id
translation:
one: one
other: other
ru.yaml
- id: variable_id
translation:
one: один
other: много
ru_RU.yaml
- id: variable_id
translation:
one: один
other: много
ua.yaml
- id: variable_id
translation:
one: один
other: багато
fr.yaml
- id: variable_id
translation:
one: one
other: other
Build
The build also is fine.
$> hugo serve --i18n-warnings --verbose
ERROR 2018/10/30 23:35:22 port 1313 already in use, attempting to use an available port
INFO 2018/10/30 23:35:22 Using config file: /raid/user/github.com/oshliaer/gists/47d150374ecece4a9e1547ea72eec7b3/site/config.toml
Building sites … INFO 2018/10/30 23:35:22 syncing static files to /
INFO 2018/10/30 23:35:22 Alias "/" translated to "/index.html"
INFO 2018/10/30 23:35:22 Alias "/" translated to "/index.html"
INFO 2018/10/30 23:35:22 Alias "/" translated to "/index.html"
INFO 2018/10/30 23:35:22 Alias "/" translated to "/index.html"
INFO 2018/10/30 23:35:22 Alias "/" translated to "/index.html"
| EN | RU | RU-RU | UA | FR
+------------------+----+----+-------+----+----+
Pages | 4 | 4 | 4 | 4 | 4
Paginator pages | 0 | 0 | 0 | 0 | 0
Non-page files | 0 | 0 | 0 | 0 | 0
Static files | 0 | 0 | 0 | 0 | 0
Processed images | 0 | 0 | 0 | 0 | 0
Aliases | 1 | 1 | 1 | 1 | 1
Sitemaps | 2 | 1 | 1 | 1 | 1
Cleaned | 0 | 0 | 0 | 0 | 0
Total in 12 ms
Watching for changes in /raid/user/github.com/oshliaer/gists/47d150374ecece4a9e1547ea72eec7b3/site/{content,data,i18n,layouts,static}
Watching for config changes in /raid/user/github.com/oshliaer/gists/47d150374ecece4a9e1547ea72eec7b3/site/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:36131/ (bind address 127.0.0.1)
Press Ctrl+C to stop
The problem
But the Russian translation is fail. Translation of the plural and zero in Russian returns the id of the variable variable_id
.
The example https://hugo_plural_form_russian.surge.sh
Please look at the assets below.
Any suggestion?
Assets
How to repeat
- go to https://gist.github.com/oshliaer/47d150374ecece4a9e1547ea72eec7b3
- test it or unpack the binary file
site.tar.gz
and runhugo