-
-
Notifications
You must be signed in to change notification settings - Fork 173
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 editing arrays for language variables #6935
Conversation
1384147
to
abb5742
Compare
I was thinking about an "entries" field for a while now too and I agree that this would be a great chance to use it here. But since we are working with a very defined set of options here, I think we could also add a toggle to switch between single value and pluralized array values. The fields could then also get better labels. I.e.
|
@bastianallgeier The tricky part is that our setup actually allows more then 3 options. A i18n translation might be defined for e.g. cases of 0, 1, 2, and more. Which needs 4 fields then. That's why Ahmet creates them dynamically from the number of array entries. |
Ok, but that makes sense. Then I would really just improve the labels |
How would you like to improve labels? |
Ah, I've just seen in the translateCount method that it's not super easy. Can we maybe explain it somehow in an info box above and then do labels like this: Count: 0 ? |
Or we do dynamic help texts as well? This string will be used if |
So what about labels? This string will be used if count is 0. This string will be used if count is 0. This string will be used if count is 0. |
Yep, I think that would be the logic. For labels it could be similar: Translation for 0 count |
Closing favor of #6963 |
Description
Summary of changes
Reasoning
We talked with Nico about how we should support array language variables.
I tried structure field but gave up because it was opened with drawer (not easy to edit each entry), it had deletion issues and it did not work fully compatible with dialog.
Nico's suggestion was to show as many inputs as there are variables in the array. I implemented this. I did not implement this in the creation part because it is not clear how many variables the user will enter, so I did not do this feature for now.
My alternative suggestion is a new field suggestion for such needs for K5 or K6;
entries
. It is similar to structure field but much simpler. You can think of it as a text field field that can be added more than once. If we have entries field in K5 or K6, we can useentries
field in the language variables part.I did not want to add unit tests without getting a full response from you. I will add it last.
Changelog
Fixes
translateCount
#6930Breaking changes
None
Docs
Ready?
For review team