Problem/Motivation

The More text configuration in Views cannot be translated.
The views dialog where the More text can be configured
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.

The translation form including the More text textfield (after applying the patch)

API changes

None.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
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.
Files: 
CommentFileSizeAuthor
#16 2418481-16-views-more-text-schema.patch578 byteststoeckler
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,088 pass(es). View

Comments

tstoeckler’s picture

Issue summary: View changes
FileSize
889 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 85,355 pass(es). View
tstoeckler’s picture

Status: Active » Needs review
tstoeckler’s picture

Issue summary: View changes
tstoeckler’s picture

Note 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.

Gábor Hojtsy’s picture

Status: Needs review » Needs work
Issue tags: +D8MI, +language-config, +sprint
+++ b/core/modules/views/config/schema/views.data_types.schema.yml
@@ -149,7 +149,7 @@ views_display:
         use_more_text:
-          type: boolean
+          type: label

Should 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.

tstoeckler’s picture

Status: Needs work » Needs review

No, 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...

tstoeckler’s picture

Oh, 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.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Yes these values are merged in at runtime.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed 2c7e51c on 8.0.x
    Issue #2418481 by tstoeckler: Views more text cannot be translated
    
Gábor Hojtsy’s picture

What, 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? :/

  • catch committed 9407ae4 on 8.0.x
    Revert "Issue #2418481 by tstoeckler: Views more text cannot be...
catch’s picture

Status: Fixed » Needs work

Reverted.

dawehner’s picture

OH 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.

Gábor Hojtsy’s picture

I 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.

tstoeckler’s picture

Status: Needs work » Needs review
FileSize
578 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,088 pass(es). View

OK, so this one should be better?!

(Just manually removed the one hunk from the patch...)

tstoeckler’s picture

Issue summary: View changes

Updated issue summary to remove mention of the default thing.

Status: Needs review » Needs work

The last submitted patch, 16: 2418481-16-views-more-text-schema.patch, failed testing.

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

That should be good.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: 2418481-16-views-more-text-schema.patch, failed testing.

Gábor Hojtsy’s picture

Failed to run tests: failed attempting to get list of tests from run-tests.sh. Should not be related to a config schema change.

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed cb0e300 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed cb0e300 on 8.0.x
    Issue #2418481 by tstoeckler: Views more text cannot be translated
    
Gábor Hojtsy’s picture

Issue tags: -sprint

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.