TranslatableInterface::getTranslationLangcodes

Created on 17 January 2017, almost 8 years ago
Updated 27 February 2023, almost 2 years ago

Problem/Motivation

There a lot of places where we need the translation langcodes of an entity but in order to retrieve them we always do
array_keys($entity->getTranslationLanguages())

As we do not always need the language objects but only the language codes it would be useful to have a method returning only them.

Proposed resolution

New method TranslatableInterface::getTranslationLangcodes.

Remaining tasks

Review.

User interface changes

None.

API changes

New method TranslatableInterface::getTranslationLangcodes.

Data model changes

None.

📌 Task
Status

Needs work

Version

10.1

Component
Entity 

Last updated about 16 hours ago

Created by

🇩🇪Germany hchonov 🇪🇺🇩🇪🇧🇬

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.

  • Needs change record

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

  • Novice

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

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.

Production build 0.71.5 2024