Skip to content

Conversation

@Dobefu
Copy link

@Dobefu Dobefu commented Oct 18, 2025

When using a translation key that is reserved in the go-i18n package, Hugo will now log an error instead of silently failing.

Fixes #14061

Please note:

  • I've looked into adding a test case, but there does not appear to be any tests for the Translate method. If wanted, I can add some. But perhaps it won't be needed for a minor change like this. Up to the reviewer(s) 🙂.
  • Since translation keys may be multiple levels deep, I did not use SplitN with a count of 1.
  • I'm intentionally not bounds checking, since an empty string will create an empty slice and won't trigger a runtime exception.
@CLAassistant
Copy link

CLAassistant commented Oct 18, 2025

CLA assistant check
All committers have signed the CLA.

When using a translation key that is reserved in the `go-i18n` package,
Hugo will now log an error instead of silently failing.

Fixes gohugoio#14061
@bep bep force-pushed the feat/warning-messages-for-reserved-i18n-keys-14061 branch from 7262713 to 87cf094 Compare October 18, 2025 13:30
@bep
Copy link
Member

bep commented Oct 19, 2025

Thanks, but this should now be covered in 559a029

@bep bep closed this Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants