I am using a multi-lingual setup to create variants of a Hugo site.
After much debugging, it appears that there is an 8-character limit on the code/name that can be used for a language.
As an example:
baseURL = "http://example.org/"
defaultContentLanguage = "abcdefg"
title = "My New Hugo Site"
[languages]
[languages.abcdefg]
languageName = "abcdefg"
title = "abcdefg"
weight = 1
[languages.abcdefgh]
languageName = "abcdefgh"
title = "abcdefgh"
weight = 1
[languages.abcdefghi]
languageName = "abcdefghi"
title = "abcdefghi"
weight = 1
and the following files in the i18n directory: abcdefg.toml, abcdefgh.toml, abcdefghi.toml, running hugo -v produces the following info message:
INFO 2021/06/18 09:35:17 Translation func for language abcdefghi not found, use default.
Is this a known issue? Perhaps a note on the Hugo multi-lingual help page underneath the text that reads " From Hugo 0.31 you no longer need to use a valid language code. It can be anything." would be useful - it can’t be anything, it can be anything up to 8 characters
If you think that will help in the documentation then go to github and create a PR in the documentation site.
I for one wouldn’t define this as bug until I know that it is one which I don’t without knowing the content of your i18n directory. If there is no file about that language then that message is normal. If that file is not parseable then that message is normal. If your language setup has issues then that might also be a result.
The way I understand that message, that the “Language Code” can be anything, while still being in alignment with the ISO standard (which I don’t find right now, but it’s a nice number ). A language code is expected to be two characters at least, with maybe a dash and two or more characters. So abcdefg wouldn’t be a proper language code either. MY-abc would be probably…
Anyway. Prove that the language-slug (I guess we are talking about [languages.THISISTHELANGUAGECODE]) is limited to 8 characters, before you call it a bug, then add an issue if you think it should be allowed to be longer