gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.94k stars 7.54k forks source link

8-Character Limit for Language Names in i18n/ #12814

Closed matypist closed 2 months ago

matypist commented 2 months ago

An error makes it impossible to create a language with a name longer than 8 characters, an error that occurs when trying to create a file with a name longer than 8 characters in i18n/:

Start building sites … 
hugo v0.133.1+extended linux/amd64 BuildDate=unknown

Total in 30 ms
Error: error building site: "art-x-123456789": language: tag is not well-formed

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.133.1+extended linux/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes

jmooring commented 2 months ago

https://gohugo.io/functions/lang/translate/#translation-tables

Private use subtags must not exceed 8 alphanumeric characters.

matypist commented 2 months ago

gohugo.io/functions/lang/translate#translation-tables

Private use subtags must not exceed 8 alphanumeric characters.

Adding a key to set a custom path for each language would be very useful then 🙏

Use case: We are working on a website for students at Sapienza University of Rome, and we are using languages as versions, one for each degree program. Therefore, we would like to have https://sapienzastudents.net/computerscience/ for the Computer Science Master's Degree version of the website, instead of the current https://sapienzastudents.net/29932/, which we are using because we can't have language names longer than 8 characters.

The website is currently hosted on GitHub pages, the Source Code is available here: https://github.com/sapienzastudentsnetwork/sapienzastudentsnetwork.github.io

jmooring commented 2 months ago

Adding a key to set a custom path for each language

See https://github.com/gohugoio/hugo/issues/9404

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.