# Table of page's translations using "range"

**URL:** <https://discourse.gohugo.io/t/table-of-pages-translations-using-range/47271>\
**Category:** support\
**Tags:** taxonomy, i18n\
**Created:** [November 27, 2023, 8:55pm UTC](https://discourse.gohugo.io/t/table-of-pages-translations-using-range/47271 "2023-11-27T20:55:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mar-ver](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mar-ver/32/20769_2.png) [@mar-ver](https://discourse.gohugo.io/u/mar-ver)\
**Post date:** [November 27, 2023, 8:55pm UTC](https://discourse.gohugo.io/t/table-of-pages-translations-using-range/47271/1 "2023-11-27T20:55:32Z")

</div>

Hi I want to make a template in form of a table that list all my article, and shows if the article is translated in the language by adding a “X” on the column of that language.

I created my header that lists all my languages (11) and I can find the translations for each article but I don’t manage to line up the language in the right column.

Here is my code. I’m getting the following error `execute of template failed at <.AllTranslations>: can’t evaluate field AllTranslations in type *langs.Language` , I guess because of iterating {{All Translations}} inside {{ .Sites.language}}. I’ve tried many combinations but find myself stuck…

```auto
<table>
    <tr>
      <th>Article title / slug</th>
    {{ range .Site.Languages}} 
    
      <th>{{ .LanguageName}} ({{ .Lang}}) <br> </th>
 
    {{ end }}
    
    </tr>
    {{ $allpages := where .Site.RegularPages "Params._build.list" "!=" "never" }} 
    {{ range $allpages.ByDate.Reverse }}
    <tr>
      <td><a href="{{.Permalink}}" rel="bookmark" title="{{.Title}}">{{.LinkTitle}}</a><br>
        <code>{{ .File.Dir }}</code>
    </td>
    
    {{ range .Site.Languages}} 
    {{ $curl := .Lang}}
    <td>
    {{ range .AllTranslations }}
     {{if eq $curl .Lang}}X (is translated) {{else }} (not translated){{end}}
    {{end}}
  </td>
    {{end}}
       
  </tr> 

  </table>

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [November 27, 2023, 9:27pm UTC](https://discourse.gohugo.io/t/table-of-pages-translations-using-range/47271/2 "2023-11-27T21:27:19Z")

</div>

> [@mar-ver](#):
>
> `AllTranslations`

You have a context problem. `AllTranslations` is a method on `Page`.

Change this:

```plaintext
{{ range $allpages.ByDate.Reverse }}

```

to this:

```auto
{{ range $p := $allpages.ByDate.Reverse }}

```

And this:

```auto
{{ range .AllTranslations }}

```

To this:

```auto
{{ range $p.AllTranslations }}

```

---

<div class="post-metadata">

**Author:** ![mar-ver](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mar-ver/32/20769_2.png) [@mar-ver](https://discourse.gohugo.io/u/mar-ver)\
**Post date:** [November 27, 2023, 9:36pm UTC](https://discourse.gohugo.io/t/table-of-pages-translations-using-range/47271/5 "2023-11-27T21:36:44Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [November 29, 2023, 9:36pm UTC](https://discourse.gohugo.io/t/table-of-pages-translations-using-range/47271/6 "2023-11-29T21:36:58Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
