# Multilingual site configuration: failed to extract shortcode, template for shortcode not found

**URL:** <https://discourse.gohugo.io/t/multilingual-site-configuration-failed-to-extract-shortcode-template-for-shortcode-not-found/56395>\
**Category:** support\
**Tags:** i18n\
**Created:** [December 18, 2025, 10:27pm UTC](https://discourse.gohugo.io/t/multilingual-site-configuration-failed-to-extract-shortcode-template-for-shortcode-not-found/56395 "2025-12-18T22:27:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pollux](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pollux](https://discourse.gohugo.io/u/pollux)\
**Post date:** [December 18, 2025, 10:27pm UTC](https://discourse.gohugo.io/t/multilingual-site-configuration-failed-to-extract-shortcode-template-for-shortcode-not-found/56395/1 "2025-12-18T22:27:41Z")

</div>

Hello,

I decided to add another language to my site, but I have trouble understanding how to configure a multilingual site in Hugo. I read [Multilingual mode](https://gohugo.io/content-management/multilingual/) and [Configure languages](https://gohugo.io/configuration/languages/) sections of the documentation and would like to use **translation by file name** instead of translation by content directory, because I prefer to have all language versions for each content item to reside in the same directory, as it feels more manageable.

So, I added a `[languages]` section to my `config.toml` file featuring two languages, and I chose the default content language along with the type of translation management:

```toml
# (...)
[languages]
	[languages.en]
		disabled = false
		languageCode = 'en-US'
		languageName = 'EN'
		title = 'Test EN'
		weight = 1
	[languages.pl]
		disabled = false
		languageCode = 'pl-PL'
		languageName = 'PL'
		title = 'Test PL'
		weight = 2
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true # Doesn't matter if it's on or off
# (...)

```

However, if I try to preview or build the site, I immediately get an error regarding shortcodes:

```auto
Error: error building site: process: readAndProcessContent: "/path_to_hugo_site/content/some_content/_index.md:8:28": failed to extract shortcode: template for shortcode "shortcode_name" not found

```

`shortcode_name.html`, as well as other shortcodes, reside in my theme’s `layouts/shortcodes/` directory and they were processed without problems before I added the language specific configuration options that I listed above.

At first, I thought that perhaps I should add a language code to each shortcode, like `shortcode_name.en.html` and `shortcode_name.pl.html`, for example, but it didn’t affect the error. Not surprising, because the documentation states that:

> If a file has no language code, it will be assigned the default language.

So I assume that if a language code is not found in any of the files, a file without the code will be used. The culprit must lie somewhere else.

Anyway, I’m wondering what am I missing here? Why does Hugo complain about the missing shortcode files? Any advice is welcome.

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [December 19, 2025, 12:03am UTC](https://discourse.gohugo.io/t/multilingual-site-configuration-failed-to-extract-shortcode-template-for-shortcode-not-found/56395/2 "2025-12-19T00:03:17Z")

</div>

- you have to move these settings _before_ the **first** table in your toml file:

- with hugo 146+ the folder should be: `_shortcodes`: [New template system in Hugo v0.146.0](https://gohugo.io/templates/new-templatesystem-overview/)

- I would lower case the `languageName` values: `en`

- use lowercase also in content file names language identifyer `foo.en.md`

maybe there is more … best  
to share a replayanle repo

---

<div class="post-metadata">

**Author:** ![pollux](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pollux](https://discourse.gohugo.io/u/pollux)\
**Post date:** [December 20, 2025, 8:06pm UTC](https://discourse.gohugo.io/t/multilingual-site-configuration-failed-to-extract-shortcode-template-for-shortcode-not-found/56395/3 "2025-12-20T20:06:06Z")

</div>

Thanks, @irkode. You’ve put me on the right tracks by mentioning parameter order. I had `[language]` block near the beginning of my `config.toml`, just below the `baseURL`. When I moved this block to the bottom of the config file, everything started working again.

---

<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:** [December 22, 2025, 8:06pm UTC](https://discourse.gohugo.io/t/multilingual-site-configuration-failed-to-extract-shortcode-template-for-shortcode-not-found/56395/4 "2025-12-22T20:06:12Z")

</div>

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