Add 'name' and 'description' for LanguageInterface::TYPE_URL

Created on 14 February 2016, almost 9 years ago
Updated 6 May 2023, over 1 year ago

Problem/Motivation

When dealing generically with language types it is annoying that LanguageInterface::TYPE_URL does not have a name or description. It is not exposed nowhere in core, but we shouldn't force contrib modules that do expose language types in some way to alter in a name and description just because we are lazy.

I personally hit this when making the URL language type configurable (which you can only do by manually editing config). The language negotiation UI then shows:

With this patch it shows:

Note again that this will generally never be shown unless you manually edit configuration.

Proposed resolution

Add a name and description to LanguageInterface::TYPE_URL.

Remaining tasks

<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->

Answer #26

User interface changes

(New or changed features/functionality in the user interface, modules added or removed, changes to URL paths, changes to user interface text.)

API changes

(API changes/additions that would affect module, install profile, and theme developers, including examples of before/after code if appropriate.)

Data model changes

(Database or configuration data changes that would make stored data on an existing site incompatible with the site's updated codebase, including changes to hook_schema(), configuration schema or keys, or the expected format of stored data, etc.)

Feature request
Status

Needs work

Version

10.1

Component
Language system 

Last updated about 7 hours ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇩🇪Germany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    Changing to feature request.

    The IS mentions

    shouldn't force contrib modules that do expose language types in some way to alter in a name and description

    Then we should test to make sure this possible.

    Will need a change record to announce to others this is possible.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India chaitanyadessai Goa

    Added 'name' and 'description' for LanguageInterface::TYPE_URL

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    @chaitanyadessai this is the same patch as #20.

    Still needs test coverage so not ready for review.

  • Status changed to Needs review over 1 year ago
  • 🇧🇪Belgium lobsterr

    Ok, let's wrap up this issue. I have added tests, which will check, that all language type have names and descriptions.

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Thanks for the tests.

    Only thing left is the change record I believe. Or explanation on why it's not needed.

    Thanks! Super close I think.

Production build 0.71.5 2024