# How to translate 404 pages

**URL:** <https://discourse.gohugo.io/t/how-to-translate-404-pages/41531>\
**Category:** support\
**Tags:** i18n\
**Created:** [November 18, 2022, 9:20pm UTC](https://discourse.gohugo.io/t/how-to-translate-404-pages/41531 "2022-11-18T21:20:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon34553931](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@anon34553931](https://discourse.gohugo.io/u/anon34553931)\
**Post date:** [November 18, 2022, 9:20pm UTC](https://discourse.gohugo.io/t/how-to-translate-404-pages/41531/1 "2022-11-18T21:20:46Z")

</div>

Is this still the way to translate 404 pages?

> [@Custom 404 per language](https://discourse.gohugo.io/t/custom-404-per-language/20239/10):
>
> It seems that Hugo does not support [translation by filename](https://gohugo.io/content-management/multilingual/#translation-by-filename) for 404 pages. I am using the i18n function to [translate strings](https://gohugo.io/content-management/multilingual/#translation-of-strings) within the singe 404.html file.

In addition, can the 404 pages be used locally? Right now I see a blank white screen on local server.

---

<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:** [November 18, 2022, 9:33pm UTC](https://discourse.gohugo.io/t/how-to-translate-404-pages/41531/2 "2022-11-18T21:33:04Z")

</div>

Hugo version?

---

<div class="post-metadata">

**Author:** ![anon34553931](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@anon34553931](https://discourse.gohugo.io/u/anon34553931)\
**Post date:** [November 18, 2022, 10:58pm UTC](https://discourse.gohugo.io/t/how-to-translate-404-pages/41531/3 "2022-11-18T22:58:31Z")

</div>

I was using version 0.89 (to test my custom theme). I have downloaded the latest version and the 404 page works now.

> [@anon34553931](#):
>
> Is this still the way to translate 404 pages?

How about this?

---

<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:** [November 18, 2022, 11:06pm UTC](https://discourse.gohugo.io/t/how-to-translate-404-pages/41531/4 "2022-11-18T23:06:01Z")

</div>

You cannot create language-specific 404 templates, so use these within the template:

`{{ T "key" }}` or `{{ i18n "key" }}`

Or if you need pluralization:

`{{ T "key" 42 }}` or `{{ i18n "key" 42 }}`

---

<div class="post-metadata">

**Author:** ![anon34553931](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@anon34553931](https://discourse.gohugo.io/u/anon34553931)\
**Post date:** [November 18, 2022, 11:27pm UTC](https://discourse.gohugo.io/t/how-to-translate-404-pages/41531/5 "2022-11-18T23:27:48Z")

</div>

> [@jmooring](#):
>
> `{{ T "key" }}` or `{{ i18n "key" }}`

This sounds easier to implement.

---

<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:** [November 20, 2022, 11:28pm UTC](https://discourse.gohugo.io/t/how-to-translate-404-pages/41531/6 "2022-11-20T23:28:02Z")

</div>

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