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

regression: IsTranslated can be wrong for "node types" #2812

Closed
pierreozoux opened this issue Dec 21, 2016 · 5 comments · Fixed by #2834
Closed

regression: IsTranslated can be wrong for "node types" #2812

pierreozoux opened this issue Dec 21, 2016 · 5 comments · Fixed by #2834

Comments

@pierreozoux
Copy link

Hello and thanks for the great work :)

I have a quick question (referring to this issue )

Our website is printing a little icon "fr" link for french translation of the home page.
(You can see it in action here: https://indie.host/ on the top right)
This was built with 0.17.

I just tried with 0.18, and the "fr" link disappeared.
I checked the value of "IsTranslated" and it is to false.

Could you tell us what happened during the upgrade, and what can we do to fix?

You can find the code for the website here:
https://git.indie.host/meta/website/tree/master

Thanks a lot!

@bep bep added the Bug label Dec 21, 2016
@bep bep added this to the v0.19 milestone Dec 21, 2016
@bep
Copy link
Member

bep commented Dec 21, 2016

Hey and thanks for the bug report.

It is the IsTranslated that is faulty.

In your case you can just remove this:

   {{ if .IsTranslated }}

If you want to replace that conditional until we get a fix for this, you can do something like this:

   {{ if gt (len .Translations) 0 }}

@bep
Copy link
Member

bep commented Dec 21, 2016

Note to self, the IsTranslated func actually looks correct, so there must be something other going on. (but the workaround still holds)

bep added a commit that referenced this issue Dec 21, 2016
@bep
Copy link
Member

bep commented Dec 21, 2016

OK, now I see it. IsTranslated is wrong for sites with only 1 translation.

@bep bep changed the title 0.18 regression about multilingual support regression: IsTranslated can be wrong for "node types" Dec 21, 2016
@pierreozoux
Copy link
Author

Happy that it helped! And thanks for your reactivity!

@bep bep modified the milestones: v0.18.1, v0.19 Dec 25, 2016
bep added a commit to bep/hugo that referenced this issue Dec 26, 2016
The new logic for creating Page objects from old node types
didn't include itself in the translation logic, so
`IsTranslated` returned falsely false for sites with only two languages.

The `AllTranslations` method also returned too few pages in that case.

This commit fixes that.

Fixes gohugoio#2812
@bep bep closed this as completed in #2834 Dec 27, 2016
bep added a commit that referenced this issue Dec 27, 2016
The new logic for creating Page objects from old node types
didn't include itself in the translation logic, so
`IsTranslated` returned falsely false for sites with only two languages.

The `AllTranslations` method also returned too few pages in that case.

This commit fixes that.

Fixes #2812
bep added a commit that referenced this issue Dec 29, 2016
The new logic for creating Page objects from old node types
didn't include itself in the translation logic, so
`IsTranslated` returned falsely false for sites with only two languages.

The `AllTranslations` method also returned too few pages in that case.

This commit fixes that.

Fixes #2812
@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 Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants