Problem/Motivation

The Link widget in /core/modules/link/config/schema/link.schema.yml has inconsistent schema configuration for its placeholder settings:
- placeholder_title correctly uses type: label (translatable)
- placeholder_url incorrectly uses type: string (not translatable)

This inconsistency prevents the URL placeholder text from being translated in multilingual sites, while the title placeholder can be translated. Both are user-facing text that should be translatable.

Steps to reproduce

* Set up a multilingual Drupal site with at least two languages
* Create a content type with a Link field
* Go to "Manage form display" for that content type
* Configure the Link field widget settings and set custom placeholder text for both URL and Title placeholders
* Go to Configuration → Regional and language → Configuration translation
* Navigate to field display configuration for your content type
* Expected: Both URL and Title placeholders should be available for translation
* Actual: Only the Title placeholder can be translated; URL placeholder is not available

Proposed resolution

Change the schema definition in /core/modules/link/config/schema/link.schema.yml

Issue fork drupal-3547582

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alorenc created an issue. See original summary.

alorenc changed the visibility of the branch 3547582-link-widget-placeholderurl to hidden.

alorenc’s picture

Assigned: alorenc » Unassigned
Status: Active » Needs review
claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

The property name, placeholder_url, might be confusing because it makes you think that the value should be a URL. But it's the placeholder text for a URL field, for instance "Fill in the target URL (e.g., http://example.com)". And that for sure should be translatable.

The fix is obvious.

astonvictor’s picture

tested locally. pretty easy to reproduce
+1 RTBC

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Makes sense to me, the property name is not clear but the explanation in #5 is helpful so thank you for that.

Committed and pushed 70944d4b526 to 11.x and 83710d2f4fe to 11.3.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • longwave committed 83710d2f on 11.3.x
    fix: #3547582 Link widget placeholder_url should use 'label' schema type...

  • longwave committed 70944d4b on 11.x
    fix: #3547582 Link widget placeholder_url should use 'label' schema type...

Status: Fixed » Closed (fixed)

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