Hi guys,

I have some basic content with a translatable field of type text
and several languages available, English being the default

I'm testing a simple workflow with translation, with the following steps:
1. create content in EN
2. translate to another language
3. update original EN version and flag translations as outdated

the translation is marked outdated correctly on the translate tab (node/{nid}/translations)
but it's not correctly marked on the TMGMT sources overview list (admin/tmgmt/sources)
screenshots attached

I looked into the tmgmt code and saw that it looks for the flag as follows:

$translations = $entity->getTranslationLanguages();
...
elseif (!empty($translations->data[$langcode]['translate'])) {
    $translation_status = 'outofdate';
}

but in core, there is the following code for setting the status:

$metadata = $this->manager->getTranslationMetadata($entity);
...
$metadata->setOutdated(...);

the data that the translation is outdated is there somewhere in the $entity, but it's protected
thus it needs to be taken from the the metadata somehow, but I'm not yet familiar with these
if you can tell me the right direction, I might be able to create a patch for this

thanks,
Reszli

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

reszli created an issue. See original summary.

Berdir’s picture

The same object also has an isOutdated() method, that should provide this information.

reszli’s picture

Berdid, thanks for the hint!
attached is a patch based on how this is done on the node/{nid}/translations page

Berdir’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Looks good, now we need a test so that this doesn't break again.

edurenye’s picture

The patch 3 was throwing an exception trying to access the TMGMT sources overview.
Now it works and I added tests.
Here you can see the result:

Status: Needs review » Needs work

The last submitted patch, 5: interdiff-outdated_translations-2603428-3-5.patch, failed testing.

The last submitted patch, 5: outdated_translations-2603428-5-test_only.patch, failed testing.

edurenye’s picture

Status: Needs work » Needs review

Sorry for that, I set the wrong file extension.

The last submitted patch, 3: outdated_translations-2603428-1.patch, failed testing.

The last submitted patch, 5: outdated_translations-2603428-5-test_only.patch, failed testing.

miro_dietiker’s picture

Status: Needs review » Fixed
Issue tags: -Needs tests

Much nice, thx.

  • miro_dietiker committed ce366bf on 8.x-1.x authored by edurenye
    Issue #2603428 by edurenye, reszli: outdated translations not reflected...

Status: Fixed » Closed (fixed)

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

edurenye’s picture

Assigned: Unassigned » edurenye
Status: Closed (fixed) » Needs work

This is broken again, and also we should add better testing.

miro_dietiker’s picture

Priority: Normal » Major

That's a major problem. TMGMT is supposed to manage translation workflows. Sure we need to properly deal with tracking outdated translations.

Berdir’s picture

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

This works fine for me, how did you test?

edurenye’s picture

Status: Postponed (maintainer needs more info) » Fixed

My mistake, I didn't labeled as outdated, maybe we could add a message or a warning telling the user that this node has translations and that he should label or something like that, now I don't think this is intuitive enough.

Status: Fixed » Closed (fixed)

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