Problem/Motivation
The More text configuration in Views cannot be translated.

The text you enter in the dialog shown above cannot be translated on the Views translation page. To reproduce this, enable Configuration Translation module and add a second language. Then a Translate Dropbutton should appear on the Views listing. Note that caches need to be cleared after applying the patch, because configuration schema is cached.
The reason is that the (inadequately named) use_more_text configuration value has the schema type string while it should have type label.
Proposed resolution
Change the schema type.
Note that this does not change the configuration structure and, thus, is not an API change.
Remaining tasks
Review.
User interface changes
This is not really a change in any meaningful sense of that word. It's just that a textfield that you expect to appear now actually appears.

API changes
None.
Beta phase evaluation
| Issue category | Bug because a view cannot be fully translated currently |
|---|---|
| Issue priority | Normal because Views is not broken |
| Unfrozen changes | Unfrozen because nothing is changed (well, strictly speaking markup on the Views translation form, but...) |
| Prioritized changes | Priorizized because it fixes a bug and improves the usability for non-English site builders |
| Disruption | No disruption. Even modules heavily altering the Config Translation form (of which none are known currently) will not break with this. |
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 2418481-16-views-more-text-schema.patch | 578 bytes | tstoeckler |
Comments
Comment #1
tstoecklerComment #2
tstoecklerComment #3
tstoecklerComment #4
tstoecklerNote that it's possible to test this, although it would be fairly arbitrary to test this particular setting and not others and as soon as the configuration structure changes the test would have to be updated, etc. So I personally vote for not requiring tests for this one although I of course don't get to make that decision.
Comment #5
gábor hojtsyShould stay as boolean no? This is part of the views display defaults settings which are booleans.
Also please tag multilingual issues with D8MI and the appropriate subtag.
Comment #6
tstoecklerNo, this setting actually stores the text that you enter in the "More text" textfield, i.e. "Read more" or whatever. It's just poorly named which is why I assume the schema was done in that way.
Sorry about the tags. One of these days I'll learn...
Comment #7
tstoecklerOh, you meant the 'defaults' one. I'm not entirely sure, but I thought those just get merged with the other ones on runtime, i.e. I thought they need to be indentical. Not 100% sure, though.
Comment #8
dawehnerYes these values are merged in at runtime.
Comment #9
catchCommitted/pushed to 8.0.x, thanks!
Comment #11
gábor hojtsyWhat, what? We have a D8 upgrade path blocker critical at #2380457: Some fixes of the views config schema which says views_display:defaults:* should all be boolean. Now I need to fix this regression there? :/
Comment #13
catchReverted.
Comment #14
dawehnerOH damn I totally forgot about it.
It would be great to remove the stupid labels from them, this is what made me believe that the patch is correct.
Comment #15
gábor hojtsyI think if we remove those labels, someone will fix them by adding them back in. They are useful for the config inspector at least as a data structure description. The parent "defaults" key has a description of "Defaults" which is misleading, it does not spell out that these would be flags on whether to apply defaults or not. BTW the "defaults" key name itself may mislead people on that. I think we should fix the "Defaults" label at least and/or fix each label to say they are a flag on whether X default is applied instead of removing labels. Not sure if that should be in scope of this issue though.
Comment #16
tstoecklerOK, so this one should be better?!
(Just manually removed the one hunk from the patch...)
Comment #17
tstoecklerUpdated issue summary to remove mention of the default thing.
Comment #20
gábor hojtsyThat should be good.
Comment #22
gábor hojtsyFailed to run tests: failed attempting to get list of tests from run-tests.sh. Should not be related to a config schema change.
Comment #24
gábor hojtsyComment #25
alexpottCommitted cb0e300 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Comment #27
gábor hojtsyThanks!
Comment #29
robertoperuzzoHi there,
I would like to re-open this issue because I'm facing a similar problem. I added my custom 'More link test' in my view
but I didn't have that string in "User interface translation" (/admin/config/regional/translate).
I found the method
useMoreText()inside classDrupal\views\Plugin\views\display\DisplayPluginBaseand added$this->t()translation function like thatIt seems to fix the issue because now I can translate the string
My project is using Drupal 9.1.9 (..yes I know I have to update it), hence I was wondering if the newer version fixes that issue.
Comment #30
Wahmed commented@robertoperuzzo you don't need to change in core, I had similar issue with "Link to Content" field in views, Drupal 9.3.5. Had to rewrite the output of field putting {{ "Read More" | t }} in the text area and then added translation from "User Interface Translation" Page.