-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Support creating/editing array language variables with using new entries
field
#7011
base: v5/develop
Are you sure you want to change the base?
Conversation
"language.variable.entries": "Entries", | ||
"language.variable.entries.help": "This strings will be used for translations count. Each entry corresponds to a different case counter. For example: 0, 1, 2 and more", |
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.
I think this would be more fitting with the existing language.variable.value
:
"language.variable.entries": "Entries", | |
"language.variable.entries.help": "This strings will be used for translations count. Each entry corresponds to a different case counter. For example: 0, 1, 2 and more", | |
"language.variable.values": "Values", | |
"language.variable.values.help": "These values will be used according to the translation count. Each entry corresponds to a different case, e.g. for 0, for 1, for 2 and more.", |
"language.variable.key": "Key", | ||
"language.variable.multiple": "Multiple", |
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.
"language.variable.multiple": "Multiple", | |
"language.variable.multiple": "Different strings based on count", |
Not so happy with this either. But I think the multiple
field needs more explanatory label and maybe also on/off texts.
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.
Absolutely. I'm not happy with the labels and help texts either. That's why I mentioned it in the PR description. It needs to be more descriptive and clear.
@@ -45,6 +45,12 @@ export default { | |||
mixins: [props], | |||
emits: ["input", "submit"], | |||
computed: { | |||
formValue() { | |||
return { | |||
...this.$helper.field.form(this.fields), |
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.
Question:
Why is this 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.
Good question.
For this line:
https://github.com/getkirby/kirby/blob/lab/afbora/support-array-language-variables/config/areas/languages/dialogs.php#L55
Otherwise default value of multiple
field is null
. We have two condition fields value
and entries
. When multiple
disabled value
field visible and when enabled entries
field visible. So when multiple
value is null
, no fields visible.
Not sure this is a correct solution.
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.
What if we don't use default
there but rather add here https://github.com/getkirby/kirby/blob/lab/afbora/support-array-language-variables/config/areas/languages/dialogs.php#L202-L205 something like
'value' => [
'multiple' => false
]
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.
Yes, it seems to be working.
What I'm wondering is; does this change I made really solve the problem of default values in dialogs? Maybe we can use it in other dialogs or in the future.
If my solution is correct I would prefer the method where the fields work exactly as intended. Otherwise I'm fine with your solution 👍
Description
Open question
Changelog
Features
Breaking changes
None
Docs
Ready?
For review team