google / docsy

A set of Hugo doc templates for launching open source content.
https://docsy.dev
Apache License 2.0
2.59k stars 894 forks source link

i18n/pt-br.toml variables, warnings #415

Open kbhawkey opened 3 years ago

kbhawkey commented 3 years ago

Hi. I have a question about the theme file, i18n/pt-br.toml and warnings generated when building:

Start building sites … 
WARN 2021/01/14 02:26:47 Failed to get translated string for language "pt" and ID "post_last_mod": %!s(<nil>)
WARN 2021/01/14 02:26:47 Failed to get translated string for language "pt" and ID "post_edit_this": %!s(<nil>)
WARN 2021/01/14 02:26:47 Failed to get translated string for language "pt" and ID "post_create_issue": %!s(<nil>)
WARN 2021/01/14 02:26:47 Failed to get translated string for language "pt" and ID "post_last_mod": %!s(<nil>)
WARN 2021/01/14 02:26:47 Failed to get translated string for language "pt" and ID "post_edit_this": %!s(<nil>)
WARN 2021/01/14 02:26:47 Failed to get translated string for language "pt" and ID "post_last_mod": %!s(<nil>)
...

Our site has defined a file: i18n/pt.toml and does not define these variables. The warnings go away if I remove the variables from the theme file (and then add to the site pt.toml). Is there a conflict in using two i18n files for the same (or similar) language (pt-br) and (pt)? Thanks!

LisaFC commented 3 years ago

Let me dig into this - Hugo uses https://github.com/nicksnyder/go-i18n, which is supposed to merge any localization bundles for the same language (with the project version taking precedence), it may have some odd behaviour where you have a regional version of a language in one source and a "general" version in the other.

kbhawkey commented 3 years ago

Thanks!