# Convert i18n/\*.toml -\> \*.json

**URL:** <https://discourse.gohugo.io/t/convert-i18n-toml-json/36598>\
**Category:** support\
**Tags:** i18n\
**Created:** [January 16, 2022, 10:06am UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598 "2022-01-16T10:06:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trob999](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Trob999](https://discourse.gohugo.io/u/Trob999)\
**Post date:** [January 16, 2022, 10:06am UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598/1 "2022-01-16T10:06:23Z")

</div>

Hello

in my i18n/ folder i have TOML files for all supported languages …  
i want to change permanently to json files - i need a script or a bash command to convert toml-\>josn  
thanks for the help

rob

PS when i deleted \*.toml then Hugo automatically takes \*.json or do i have to config that somewhere?

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [January 16, 2022, 10:57am UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598/2 "2022-01-16T10:57:53Z")

</div>

> [@Trob999](#):
>
> i need a script or a bash command to convert toml-\>josn  
> thanks for the help

This is not a forum for bash script file conversions.  
Please search the UNIX / Linux forums and/or StackOverflow.

> [@Trob999](#):
>
> when i deleted \*.toml then Hugo automatically takes \*.json or do i have to config that somewhere?

Hugo config can be in toml, json or yaml. If you provide a json it should be picked up without doing anything.

---

<div class="post-metadata">

**Author:** ![Trob999](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Trob999](https://discourse.gohugo.io/u/Trob999)\
**Post date:** [January 16, 2022, 11:08am UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598/3 "2022-01-16T11:08:02Z")

</div>

1. ok - I thought other here might have had someone the same problem or Hugo has somewhere a hidden function
2. Thanks  
cu rob

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [January 16, 2022, 11:12am UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598/4 "2022-01-16T11:12:08Z")

</div>

> [@Trob999](#):
>
> I thought other here might have had the same problem or Hugo has somewhere a hidden function

Hugo has the CLI command [`hugo convert`](https://gohugo.io/commands/hugo_convert_tojson/#readout) that is meant for converting the front matter format of content files.

You may try and see if it suits your use case, however you would still need to change the file extension to JSON manually.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [January 16, 2022, 12:28pm UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598/5 "2022-01-16T12:28:57Z")

</div>

> **[TOML\<-\>JSON Online Converter](https://pseitz.github.io/toml-to-json-online-converter/)**
>
> Convert TOML to JSON right here on this page

---

<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:** [January 16, 2022, 4:33pm UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598/6 "2022-01-16T16:33:55Z")

</div>

If you need to convert more than one or two files (e.g., an `i18n` directory with 20 toml files), you might consider [https://github.com/sclevine/yj](https://github.com/sclevine/yj).

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [January 17, 2022, 6:00am UTC](https://discourse.gohugo.io/t/convert-i18n-toml-json/36598/7 "2022-01-17T06:00:25Z")

</div>

This topic was automatically closed after 19 hours. New replies are no longer allowed.
