In Drupal 8 it's possible to have a static interface language (german in my case) and selectable entity languages (ie. german and english, using german as default language).

In the Linkit dialog the autocomplete search uses the correct language of the entity. Opening the Linkit dialog to edit a link, the titles displayed as Link and Selected link always use german. Don't know whether Linkit uses the default entity language or the interface language.

Greats from Germany
LeisureLarry

Comments

LeisureLarry created an issue. See original summary.

LeisureLarry’s picture

Issue summary: View changes
LeisureLarry’s picture

Found the problem in linkit_form_editor_link_dialog_alter. In the try-catch-block you load the entity in order to fill the default values of the form. But you don't use getTranslationFromContext after getting the entity. Fixed it by adding it.

$entity = \Drupal::service('entity.repository')
  ->loadEntityByUuid($input['data-entity-type'], $input['data-entity-uuid']);
$entity = \Drupal::service('entity.repository')->getTranslationFromContext($entity);

Greats from Germany
LeisureLarry

  • anon committed a59f1fb on 8.x-5.x
    Issue #2844688 by LeisureLarry, anon: Wrong language in Linkit dialog
    
anon’s picture

Status: Active » Fixed

Thanks for the solution.

Status: Fixed » Closed (fixed)

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