VocabularyListBuilder::buildRobuildRow doesn't use the available translations:

    $row['label'] = $entity->label();

This results in the source language being displayed.

We probably need to check if the entity has a translation first and load that one.

Comments

mpp created an issue. See original summary.

piggito’s picture

I'm attaching a patch similar to the one on https://www.drupal.org/project/drupal/issues/2872646#comment-12054660 to show translated taxonomy vocabularies on admin UI.

piggito’s picture

Status: Active » Needs review
mpp’s picture

Title: Translations of taxonomy vocabulary not show on admin overview » Translations of taxonomy vocabulary not shown on admin overview
Status: Needs review » Reviewed & tested by the community

rtbc

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs work

This was an explicit choice, see #2136559: Config entity admin lists show configuration with overrides (eg. localized). So this needs at the very least some more discussion on how to resolve the issues that were fixed there.

mpp’s picture

@tsoeckler, can you explain what issue remains?

The page you refer states:

The problem starts when you actually want to edit it. Well, once you hit the edit screen, you'll ("obviously") edit the original configuration entity that is for shipped content types the English configuration.

But this is no longer the case, when I click edit, I ("obviously") go to the localized edit form.

Also see my remark in https://www.drupal.org/project/drupal/issues/2872646

tstoeckler’s picture

But this is no longer the case, when I click edit, I ("obviously") go to the localized edit form.

Actually that's not true. Reading that comment over there I think you might be confusing config translation and content translation. The content language page and language fallbacks do not apply to config translation and for config translation you also don't see the "translated" edit form, but always get the edit form in the untranslated form.

mpp’s picture

Well, no. I create an English menu (config) and a dutch menu (config). I go the the English overview and click edit on both and both appear in English. I go to the Dutch overview and click edit on both and both appear in Dutch. As it should.

tstoeckler’s picture

Status: Needs work » Postponed (maintainer needs more info)

Well, you can say that it should be that way, but that's arguable. What's more important is that that's actually not the normal behavior in core. You'll need to provide more explicit steps to reproduce. Maybe it is some contrib module that is altering this behavior. But without some explicit steps to reproduce you're situation we cannot move forward here.

mpp’s picture

No, steps to reproduce only include Standard profile:

- Go to https://simplytest.me/ and install Drupal 8.5.x
- Enable language and config_translation
- Add Dutch language
- Add a Dutch and an English menu

On the menu overview in both languages (English: /admin/structure/menu & Dutch: /nl/admin/structure/menu) all edit links properly direct to the edit detail in the same language.

In these steps you can swap menu with vocabulary.

jhodgdon’s picture

The steps in #11 refer to menus. This issue is about taxonomy. Also see the most recent comment #18 on #2872646-18: Menu overview always shows the untranslated config entities for why this is a bad idea to change for menus; the same applies to taxonomy:
- If you are on the Taxonomy (or menu) overview page, and click Edit, you will be editing the base version of that vocabulary (the base language).
- Therefore, the taxonomy overview page should show the base version of the vocabulary, not a localized version.

jhodgdon’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

The menu related issue is closed as won't fix. See #2872646-19: Menu overview always shows the untranslated config entities. The same applies here.

StephenN’s picture

If the decision above does not fit your use case and you do not want to alter core you can add the following into a custom module to override the default behaviour.

use Drupal\taxonomy\Entity\Vocabulary;

/**
 * Implements hook_form_alter().
 *
 * Force taxonomy overview (/admin/structure/taxonomy) to display vocabularies
 * in current interface language.
 */
function CUSTOM_MODULE_NAME_form_taxonomy_overview_vocabularies_alter(&$form, $form_state, $form_id) {
  foreach ($form['vocabularies'] as $key => $vocabArr) {
    if (substr($key, 0, 1) != '#') {
      $vocabEntity = Vocabulary::load($key);
      $form['vocabularies'][$key]['label']['#markup'] = $vocabEntity->get('name');
      $form['vocabularies'][$key]['description']['data']['#markup'] = $vocabEntity->get('description');
    }
  }
}
alternativo’s picture

You have to enable Content Translation module, and select taxonomy vocabularies you want to be translated, and you will see translation buttons in every single fields/terms