# I18n + range loop section

**URL:** <https://discourse.gohugo.io/t/i18n-range-loop-section/46644>\
**Category:** support\
**Tags:** i18n\
**Created:** [October 12, 2023, 1:27pm UTC](https://discourse.gohugo.io/t/i18n-range-loop-section/46644 "2023-10-12T13:27:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![buhbuhtig](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/buhbuhtig/32/20533_2.png) [@buhbuhtig](https://discourse.gohugo.io/u/buhbuhtig)\
**Post date:** [October 12, 2023, 1:27pm UTC](https://discourse.gohugo.io/t/i18n-range-loop-section/46644/1 "2023-10-12T13:27:16Z")

</div>

I have a multilingual website with translation by content directory.  
So:

```auto
content/
├─ en/
│ ├─ blog
│ ├─ _index.md
│ ├─ post1.md
│ ├─ post2.md
│
├─ fr/
│ ├─ blog
│ ├─ _index.md
│ ├─ post1.md
│ ├─ post2.md

```

```auto
config.toml
[languages]
  [languages.en]
    contentDir = "content/en"
  [languages.fr]
    contentDir = "content/fr"

```

I want to iterate\loop over the posts in the blog in the current language (let’s say “en”), so I use:

```auto
{{ range where .Site.RegularPages "Section" "blog" }}
...

```

… and it doesn’t work because it turns out that sections are “en” and “fr”.  
“blog” is subsection.

How to perform seamless iteration (I mean, considering the current language and only with its posts)?

What’s the best practice when dealing with i18n in that case?

thx!

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [October 12, 2023, 1:32pm UTC](https://discourse.gohugo.io/t/i18n-range-loop-section/46644/2 "2023-10-12T13:32:02Z")

</div>

Do you have a modules.mount config as well?

---

<div class="post-metadata">

**Author:** ![buhbuhtig](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/buhbuhtig/32/20533_2.png) [@buhbuhtig](https://discourse.gohugo.io/u/buhbuhtig)\
**Post date:** [October 12, 2023, 3:53pm UTC](https://discourse.gohugo.io/t/i18n-range-loop-section/46644/3 "2023-10-12T15:53:39Z")

</div>

No. I didn’t think it was so complicated… I will figure it out… Thanks for the tip

---

<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:** [October 14, 2023, 3:54pm UTC](https://discourse.gohugo.io/t/i18n-range-loop-section/46644/4 "2023-10-14T15:54:20Z")

</div>

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