trenz-gmbh / trenz-docs

An SPA wiki made by TRENZ
MIT License
3 stars 0 forks source link

Multilingual support #8

Open chucker opened 2 years ago

chucker commented 2 years ago

A document should optionally be available in multiple languages. In this case, a file naming convention is used. For example, if a document is available in English and German, the following two files should exist:

My-feature.en.md
My-feature.de.md

ToDo

How do we do per-language titles? A YAML header?

ricardoboss commented 2 years ago

What if wee do something like we did for authorization? Add a .i18n/.lang (or something other than that) in a folder which specifies which files have which title in what language, what the default/fallback language should be and maybe even which languages to show in the first place.

fallback = "en"
visible = ["en", "de"]

[en]
foo = "How to calculate Foo"

[de]
foo = "Wie man Foo berechnet"

[fr]
foo = "WIP"
chucker commented 2 years ago

I think fallback should be global. Defining it per-folder sounds like too much work.

But… yeah, I guess we could do a folder-level list of localized titles. In this case, is foo the filename without extension?

ricardoboss commented 2 years ago

Yeah. I'm not sure there would be a better option other than using frontmatter in each file