Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get translated string for language "art-x-language" #7838

Closed
maximilian-lindsey opened this issue Oct 15, 2020 · 12 comments
Closed
Assignees
Milestone

Comments

@maximilian-lindsey
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version 0.76.5

Does this issue reproduce with the latest release?

Yes and also with version 0.76.4.

It doesn't happen with version 0.74.0

Problem

We are getting a long list of warning for like this for all our languages ("de","fr","es","it","nl","fr-be","nl-be", "pl", "bg", "ro", "hu", "cz","com","at"), that causes our build pipelines buffer to exceed it's limits:

16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "ratings": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "showmore": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "techdata": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "defaultHeadline": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "showmore": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "homepage": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "Modelle": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "techdata": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "showmore": %!s()
16:12:12 WARN 2020/10/15 14:12:12 Failed to get translated string for language "art-x-cz" and ID "introtext": %!s()
16:12:12 WARN 2020
16:12:12
16:12:12 Build failed: RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded

There is no trace of any language "art-x-cz or similiar in our codebase.

Could you please look into this?

Thanks a lot for your support

@maximilian-lindsey maximilian-lindsey changed the title Failed to get translated string for language "art-x-LANGUAGE" Failed to get translated string for language "art-x-language" Oct 15, 2020
@maximilian-lindsey
Copy link
Author

Maybe this is related to #7822 ?

@mhuberas24
Copy link

mhuberas24 commented Oct 15, 2020

this is only the case for the "artifical" languages we use. In our case at, com, cz, and test. Renaming _index.cz.md to _index.cs.md and changing the configs rermoved the above mentioned error. So it seems to be related how hugo (go) handles the custom languages.

Did some additional digging:
Problems start with 0.76 (first with the no plural rule registered error (till 0.73) and then with the ones mentiones above)

@bep bep self-assigned this Oct 16, 2020
@bep bep added this to the v0.76.6 milestone Oct 16, 2020
@bep
Copy link
Member

bep commented Oct 16, 2020

I will have a look at this soonish, but today I'm busy busy with other things. This i18n upgrade from v1 to v2 was certainly more painful than I expected, but hopefully it's worth it.

@goose3228
Copy link

I'm having the same issue, had to downgrade to 0.75, but was unable to reproduce outside of CI - worked fine locally.

@rue2020
Copy link

rue2020 commented Oct 23, 2020

...same thing here, confirmed for 7.6.5 - not a dealbreaker, since page renders fine, nevertheless a bit concerning.

@bep bep modified the milestones: v0.76.6, v0.77, v0.78 Oct 30, 2020
@rue2020
Copy link

rue2020 commented Nov 3, 2020

confirmed for version 7.7.

@maximilian-lindsey
Copy link
Author

maximilian-lindsey commented Nov 5, 2020

I got the warning locally again when I just ran it with Hugo Static Site Generator v0.78.0/extended darwin/amd64
Warning: Failed to get translated string for language "art-x-cz"

@jmooring
Copy link
Member

jmooring commented Apr 9, 2021

Does anyone have a minimal reproducible example of this with v0.82 or later?

@dan-rigdon-bel
Copy link

Does anyone have a minimal reproducible example of this with v0.82 or later?

Sent a minimal sample to reproduce this via PM.

@jmooring
Copy link
Member

jmooring commented Apr 9, 2021

@dbelcher Thank you.

Minimal reproducible example...

The layouts/_default/single.html template calls i18n twice, once for a singular translation, and once for a plural translation.

git clone --single-branch -b hugo-github-issue-7838 https://github.com/jmooring/hugo-testing hugo-github-issue-7838
cd hugo-github-issue-7838
hugo server

Results:

WARN 2021/04/09 13:51:15 Failed to get translated string for language "art-x-kr" and ID "cat": %!s(<nil>)
WARN 2021/04/09 13:51:15 Failed to get translated string for language "art-x-kr" and ID "cat": %!s(<nil>)
WARN 2021/04/09 13:51:15 Failed to get translated string for language "art-x-tw" and ID "cat": %!s(<nil>)
WARN 2021/04/09 13:51:15 Failed to get translated string for language "art-x-tw" and ID "cat": %!s(<nil>)

Now comment out the Japanese and Korean sections in config.toml and run hugo again:

WARN 2021/04/09 13:53:00 Failed to get translated string for language "art-x-tw" and ID "cat": %!s(<nil>)
WARN 2021/04/09 13:53:00 Failed to get translated string for language "art-x-tw" and ID "cat": %!s(<nil>)

Now do this:

rm i18n/jp.toml i18n/kr.toml
hugo

No warnings. I don't understand.

@rockingdice
Copy link

I've experienced the same issue with latest version hugo v0.82.1-60618210
I used custom language 'cht' and 'jp', they cannot be translated correctly. I've upgraded the client from a fairly old version (~2019), is there anything that I missed like any configuration?

@bep bep added the Upstream label Apr 23, 2021
bep added a commit to bep/hugo that referenced this issue Apr 30, 2021
This fixes a bug upstream by temporarily using a patched version of go-i18n.

Closes gohugoio#7838
@bep bep closed this as completed in 7eb80a9 Apr 30, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants