hugolib: Discard current language based on .Lang()
authorAbdó Roig-Maranges <abdo.roig@gmail.com>
Sun, 19 Feb 2017 14:00:18 +0000 (15:00 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 19 Feb 2017 14:00:18 +0000 (15:00 +0100)
Otherwise we fail to skip the current language in translations
for paginated pages.

Fixes #2972

hugolib/page.go

index 6af6a2da50b718dd83137c0d2a98471afca5cd0a..446e17b6a07c3c4c126db95b51874f3d46afb58e 100644 (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)
                }
        }