# In\_array in IF

**URL:** <https://discourse.gohugo.io/t/in-array-in-if/13022>\
**Category:** support\
**Created:** [July 19, 2018, 7:28am UTC](https://discourse.gohugo.io/t/in-array-in-if/13022 "2018-07-19T07:28:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![igramnet](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/igramnet/32/2715_2.png) [@igramnet](https://discourse.gohugo.io/u/igramnet)\
**Post date:** [July 19, 2018, 7:28am UTC](https://discourse.gohugo.io/t/in-array-in-if/13022/1 "2018-07-19T07:28:12Z")

</div>

Hello. I want to check which languages the current page has.  
I know the current language and I have function {{ .Translations }}  
Now I have the code

```
{{ $lang := .Lang }}
{{ $current_url := .URL }}
{{ range $.Site.Home.AllTranslations }}
{{ if or (eq $lang .Language.LanguageName) (in_array.Language.LanguageName, .Translations) }}
<a{{ if eq $lang .Language.LanguageName }} class="active_l"{{ end }} href="{{ .LanguagePrefix }}{{ $current_url }}">{{ .Lang }}</a>
{{ end }}
{{ end }}

```

How can I change this fragment ‘**in\_array.Language.LanguageName, .Translations)**’ ?

---

<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:** [July 19, 2018, 1:37pm UTC](https://discourse.gohugo.io/t/in-array-in-if/13022/2 "2018-07-19T13:37:43Z")

</div>

[`in`](https://gohugo.io/functions/in/#readout) pops to mind.

---

<div class="post-metadata">

**Author:** ![igramnet](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/igramnet/32/2715_2.png) [@igramnet](https://discourse.gohugo.io/u/igramnet)\
**Post date:** [July 20, 2018, 12:10pm UTC](https://discourse.gohugo.io/t/in-array-in-if/13022/3 "2018-07-20T12:10:57Z")

</div>

> [@igramnet](#):
>
> ```auto
> 
> ```
> 
> How can I change this fragment ‘ **in\_array.Language.LanguageN**

Thank you, but can you give me example?

My code is

> ```
> {{ $lang := .Lang }}
> {{ range .Page.AllTranslations }}
> {{ if or (eq $lang .Language.LanguageName) (in .Lang .Translations) }}
> <a{{ if eq $lang .Language.LanguageName }} class="active_l"{{ end }} href="{{ .Permalink }}">{{ .Lang }}</a>
> {{ end }}
> {{ end }}
> 
> ```

and it doesn’t work.
