Hi,

When you use a custom url in the more link configuration it can't be translated if you have more than one language on the system.

My proposition is change the data schema type for this element from string to text to allow translation.

Greetings.

Proposed fix:

  • Change the config type to text so these values can be translated
  • In other similar issues there was no update added, so follow that pattern and don't add an update hook

Comments

jncruces created an issue. See original summary.

jncruces’s picture

I think that the following patch I think that will resolve the problem.

jncruces’s picture

StatusFileSize
new904 bytes

I found that a rewritten field linked to a url can't be translatable too.

I think that these are two issues relationed. The next patch resolve the previous reported issue and this too.

jncruces’s picture

StatusFileSize
new752 bytes

Sorry the previous patch was from another issue. Correcting with the correct patch.

jncruces’s picture

Status: Active » Needs review

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

kristen pol’s picture

Version: 8.9.x-dev » 9.1.x-dev
Category: Feature request » Bug report
Issue tags: +Bug Smash Initiative

Sounds like a bug if you can't translate. Patch applies cleanly to 9.1.

kristen pol’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests, +Needs manual testing

The patch is straightforward but this needs tests and manual testing. Back to needs work for tests.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

mohit_aghera’s picture

Hi @Kristen Pol @larowlan
I've added the test cases for verification.
Currently, I've implemented functional test cases and on views translation page, I am checking if fields exist or not.

Any thoughts if we can achieve this using Kernel tests? I didn't found any specific schema tests in config_translation module.

Status: Needs review » Needs work
mohit_aghera’s picture

Status: Needs work » Needs review
kristen pol’s picture

@mohit_aghera Thanks for the tests :) I didn't find any kernel tests for similar things, but maybe I missed them. I see tests for link_url in:

./core/modules/views_ui/tests/src/Functional/DisplayTest.php
./core/modules/views/tests/src/Functional/Plugin/DisplayTest.php

and for Views config_translation in:

./core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php

Maybe it makes sense to move your tests to TranslatedViewTest?

mohit_aghera’s picture

Assigned: jncruces » mohit_aghera
Status: Needs review » Needs work

Sure, let me refactor the tests today and move to appropriate places.

mohit_aghera’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new40.91 KB
new3.5 KB

Refactoring test cases.
Please ignore this comment due to incorrect diff with 9.2.x HEAD

mohit_aghera’s picture

StatusFileSize
new8.47 KB
new3.5 KB

Re-uploading the patch.
By mistake, I took incorrect diff with older 9.2.x HEAD

kristen pol’s picture

Thanks for moving the test code. This still needs manual testing. Let me see if anyone on the bugsmash team has time to do that.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lendude’s picture

Status: Needs review » Needs work

Looking good already. Just nits.

Can we not add the new test assertions to \Drupal\Tests\views_ui\Functional\TranslatedViewTest::testTranslatedStrings directly and use the views.view.files view like that does? Seems like a bit of a waste to do a new test and add a whole new view.

mohit_aghera’s picture

Status: Needs work » Needs review
StatusFileSize
new2.64 KB
new9.22 KB

@Lendude,
I've updated patch and removed the custom view.
However, the process was little tricky and I had to add the "block" in files view.
Because we don't get "More link" option with custom link on general views.

I had performed other changes as well.

lendude’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs manual testing

@mohit_aghera great cleanup, makes it much easier to follow.

Manually tested this and the translation does indeed show up.

Updated the IS a bit, and added that we don't normally have update hooks for these.

chetanbharambe’s picture

Assigned: mohit_aghera » Unassigned
StatusFileSize
new281 KB
new260.98 KB

Verified and tested patch #21.
Patch applied successfully and looks good to me.

Testing Steps:
# Goto: Extend -> Enable Content translation and configuration translation
# Add any multiple languages -> admin/config/regional/language
# Goto: admin/structure/views/view/content
# Click on +Add link to add one block
# Click on "Content: Title (Title)"
# Click on Rewrite results
# Enable the checkbox for "Output this field as a custom link"
# Apply it
# Click on Translate View
# Click on add for respective language
# Click on: DEFAULT DISPLAY SETTINGS
# Click on: TITLE VIEWS ENTITY FIELD HANDLER
# Click on: REWRITE RESULTS
# User is not able to see Link path and link URL

Expected Results: The link URL in views must be translatable.

Actual Results: Currently The link URL in views is not translatable.

Please refer attached screenshots for the same.
Looks good to me.
Can be a move to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed db660b7 and pushed to 9.3.x. Thanks!

ONly committed to 9.3.x as this requires a cache flush to work. We have an update function for the user module so a cache flsuh is already guaranteed for sites going to 9.3.0 so we don't need to add an empty post update here.

  • alexpott committed db660b7 on 9.3.x
    Issue #3008138 by mohit_aghera, jncruces, chetanbharambe, Kristen Pol,...

Status: Fixed » Closed (fixed)

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