# Passing a variable to replace function

**URL:** <https://discourse.gohugo.io/t/passing-a-variable-to-replace-function/5487>\
**Category:** support\
**Created:** [February 16, 2017, 7:13pm UTC](https://discourse.gohugo.io/t/passing-a-variable-to-replace-function/5487 "2017-02-16T19:13:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vichenze](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@vichenze](https://discourse.gohugo.io/u/vichenze)\
**Post date:** [February 16, 2017, 7:13pm UTC](https://discourse.gohugo.io/t/passing-a-variable-to-replace-function/5487/1 "2017-02-16T19:13:16Z")

</div>

Hello,  
Since there seems to be no support of internationalization for the date format, I’d like to use the replace function instead.

But I can’t find the right syntax to this:

`<h2 class="subtitle is-6">{{ replace {{ .Date.Format "2 January 2006" }} "December" "Décembre" }}</h2>`

error: unexpected “{” in operand  
Is there a way to use replace with a the date parameter ? Even if it’s not a perfect solution because I’ll have to use it 12 times…

Thanks !

---

<div class="post-metadata">

**Author:** ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)\
**Post date:** [February 16, 2017, 8:17pm UTC](https://discourse.gohugo.io/t/passing-a-variable-to-replace-function/5487/2 "2017-02-16T20:17:22Z")

</div>

Your approach looks good but nesting curly-braces isn’t valid syntax. Rather try this:

```
<h2 class="subtitle is-6">{{ replace (.Date.Format "2 January 2006") "December" "Décembre" }}</h2>

```

But you could also have a look at [this workaround](https://discuss.gohugo.io/t/dates-only-in-english/1317/5?u=digitalcraftsman) by @RickCogley

---

<div class="post-metadata">

**Author:** ![vichenze](https://avatars.discourse-cdn.com/v4/letter/v/85e7bf/32.png) [@vichenze](https://discourse.gohugo.io/u/vichenze)\
**Post date:** [February 16, 2017, 9:56pm UTC](https://discourse.gohugo.io/t/passing-a-variable-to-replace-function/5487/3 "2017-02-16T21:56:04Z")

</div>

It worked perfectly with the config file in data + the index function. Thanks a lot 🙂
