Can I localize md files by Json or toml

I’m thinking of using Hugo Generator to create offline documents.

I learned that Hugo supports multiple languages by adding an language code to files.

first-page.md
first-page.ja.md

In this case, it is troublesome because the layout must be written for each page.

My ideal is to put language data together in a json file and refer to it in the same .md file like this.

first-page.md
first-page.json
first-page.ja.json

[first-page.md]

title: “First Page”

# {{hello}}

[first-page.json]
{
“hello”: “Hello”
}

[first-page.ja.json]
{
“hello”: “こんにちは”
}

Of course, this is “ideal” and will not actually work. Is there a similar way to describe this in Hugo?

you can do it the way hugo is built on : https://gohugo.io/content-management/multilingual/

and a great article https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/

Thank you for your replying.

I created language files in the data folder according to the document, but the text is not replaced and is output as it is.

quickstart/
 ├ data/
 │  ├ test.en.json
 │  └ test.ja.json
 ├ content/
 │ └ posts/
 │   └ first-post.md
  • first-post.md
# test 

{{ .Site.Data.test[.Site.Language.Lang].hello }}
{{ .Site.Data.test.en.hello }}

This is a test page.

Have a look at my repo, where I’ve done this, e.g. for a carousel on the home page:

I thought Hugo doesn’t supported in current version. So I’ll copy md files in a batch file.