hugolib: Discard current language based on .Lang()

Otherwise we fail to skip the current language in translations
for paginated pages.

Fixes #2972
This commit is contained in:
Abdó Roig-Maranges 2017-02-19 15:00:18 +01:00 committed by Bjørn Erik Pedersen
parent 6809ea1e7c
commit 02b120d1bd

View file

@ -860,7 +860,7 @@ func (p *Page) IsTranslated() bool {
func (p *Page) Translations() Pages {
translations := make(Pages, 0)
for _, t := range p.translations {
if t != p {
if t.Lang() != p.Lang() {
translations = append(translations, t)
}
}