Skip to content

Adding Translated Documents #23

Answered by daveaglick
yamatoya asked this question in Q&A
Discussion options

You must be logged in to vote

There's nothing in-the-box right now, though you could certainly add folders like input/ja-jp directly and the files inside would output to that location. Another approach I've seen is to load JSON files with various translations and locales:

en-us.json:

{
  "foo": "buzz"
}

ja-jp.json:

{
  "foo": "bazz"
}

Then use those values inside a Razor template with something like Outputs["ja-jp.json"].First().GetString("Foo"). A more sophisticated setup could even put the translation files in a subdirectory, iterate on them, and produce an output document for each one. This approach works well when you've got common content with just a handful of things that need to be translated.

Eventually Statiq…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yamatoya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #23 on October 19, 2020 12:22.