Enable labels (of collections, fields) to be translated through i18n ressources #6998
olivier5741
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Labels translation can only be defined in code in the collection itself. Calling i18next.t or useTranslation in collection config doesn't work (anything hack is welcome ;) ). The only way is through redefining the Label component but that's one side of the problem since RowLabel cannot be redefined.
One option is to add a few lines of code in getTranslation (https://github.com/payloadcms/payload/blob/main/packages/payload/src/utilities/getTranslation.ts) to litteraly get the translation from i18next (not just ask i18next for the language). It could be based on a general settings (translateLabels: true)
Beta Was this translation helpful? Give feedback.
All reactions