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

Pagination of multilingual pages is slightly broken #2972

Closed
aroig opened this issue Jan 21, 2017 · 3 comments · Fixed by #2976
Closed

Pagination of multilingual pages is slightly broken #2972

aroig opened this issue Jan 21, 2017 · 3 comments · Fixed by #2976
Labels

Comments

@aroig
Copy link
Contributor

aroig commented Jan 21, 2017

If I add a paginator on a section page which is translated to several languages, two problems appear:

  1. The cross-language links obtained from .Translations from a page in the pagination sequence different from the first, point always to the first page of the translation.
  2. The .Translations variable for non-first pages includes the first page of the current language.

I think 2 may be a consequence of 1. It looks like 1 is going to be annoying to fix, since pagination happens very late in the rendering process. I guess a good way to fix it would be to make pagination pages into proper pages, etc, etc.

@bep
Copy link
Member

bep commented Jan 22, 2017

Please don't use "broken" unless you have a well defined "correct solution".

There may be work to be done with pagination vs multilingual (had to stop somewhere), but I'm not sure this is one of them.

I see 3 alternatives:

  1. Return an empty .Translations for pages > 1 because we have no good way of guessing translation.
  2. Link to the same page, so "/home/en/32" => "/home/no/32"
  3. Always link to page 1 (current status)

2 would very rarely be correct (as it would need 1:1 translation for all languages, with equal sorting, taxonomy definition etc.), and it isn't cost effective to try to implement some logic around it.

So then it is 1 or 3?

aroig added a commit to aroig/hugo that referenced this issue Jan 22, 2017
Otherwise we fail to skip the current language in translations
for paginated pages.

Fixes gohugoio#2972
@aroig
Copy link
Contributor Author

aroig commented Jan 22, 2017

Please don't use "broken" unless you have a well defined "correct solution".

I was thinking of 2 above, but as you point out this can't be a general solution because of missing translated pages. In that case, I agree that current behavior is ok.

In a blog-like site, one may want to fall back to a different language instead of skipping a missing translated page. In such mode, then 2 would make sense.

The second problem I reported is fixed by #2976.

@bep bep closed this as completed in #2976 Feb 19, 2017
bep pushed a commit that referenced this issue Feb 19, 2017
Otherwise we fail to skip the current language in translations
for paginated pages.

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

Successfully merging a pull request may close this issue.

2 participants