Also add all translations, including the current, to the slice. We filter later.
return err
}
- if renderBuffer.Len() == 0 {
- if p, ok := d.(*Page); ok {
- fmt.Println(">>>>", p.Lang(), len(p.Content))
- }
- }
-
outBuffer := bp.GetBuffer()
defer bp.PutBuffer(outBuffer)
func assignTranslationsToPages(allTranslations map[string]Translations, pages []*Page) {
for _, page := range pages {
+ page.translations = page.translations[:0]
base := page.TranslationBaseName()
trans, exist := allTranslations[base]
if !exist {
// TODO(bep) multilingo remove lang
for _, translatedPage := range trans {
- if translatedPage == page {
- continue
- }
page.translations = append(page.translations, translatedPage)
}