Such as ‘en-US’.
I have onfigured the language, But always empty after rendering {{ i18n "posts" }}
or {{ T "posts" }}
Site config:
defaultContentLanguage: zh-CN
zh-CN.toml
[posts]
other = "帖子"
Use {{ i18n "posts" }}
in layout files, The result is empty. According to the document convention, this is the lack of translation.
After studying, I found a problem!
Here are two cases
Case can working
Site config:
defaultContentLanguage: en
en.toml:
[posts]
other = "Posts"
Case can’t working
Site config:
defaultContentLanguage: en-US
en-US.toml:
[posts]
other = "Posts"
I think it’s a bug and I hope it can be solved.
In addition, there is a small suggestion:
I18N files want to use YML and simplified syntax.
Such as
home: Home
posts: Posts
It’s much more convenient than the following grammar.
[home]
other = "Home"
[posts]
other = "Posts"