-
-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validator for default_language
in language control panel
#6811
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for plone-components canceled.
|
config.registerUtility({ | ||
name: 'default_language', | ||
type: 'validator', | ||
dependencies: { format: 'default_language' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use fieldName: 'default_language'
so plone/plone.i18n#73 isn't needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have this feature (yet). Do you really think it's the way to go? For me, the problem is the lack of expressivity in the definition of the fields in the backend source, which is not Volto to blame. And it's not only here. It's all over the place in the backend fields definitions.
Specially on control panels. So the field fix in plone/plone.i18n#73 should not only be the hint for the client side validation, but also having a server one where the validation of the default_language
field is tied to the available_languages
one.
Fixes the use case that you can save a new default language without adding it to the list of available languages.
Now it complains, on blur and on save.
Probably, it would need a server side validator too.
Depends on plone/plone.i18n#73 but not requires it.
Also fixes a section of the docs that was incorrect.
📚 Documentation preview 📚: https://volto--6811.org.readthedocs.build/