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
Comment | File | Size | Author |
---|---|---|---|
#5 | outdated_translations-2603428-5.patch | 1.96 KB | edurenye |
| |||
#5 | outdated_translations-2603428-5-test_only.patch | 839 bytes | edurenye |
| |||
#5 | outdated_translations-2603428-5.png | 40.24 KB | edurenye |
#3 | outdated_translations-2603428-1.patch | 1.09 KB | reszli |
sources_overview.png | 89.52 KB | reszli |
Comments
Comment #2
BerdirThe same object also has an isOutdated() method, that should provide this information.
Comment #3
reszliBerdid, thanks for the hint!
attached is a patch based on how this is done on the node/{nid}/translations page
Comment #4
BerdirLooks good, now we need a test so that this doesn't break again.
Comment #5
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedThe 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:
Comment #8
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedSorry for that, I set the wrong file extension.
Comment #11
miro_dietikerMuch nice, thx.
Comment #14
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedThis is broken again, and also we should add better testing.
Comment #15
miro_dietikerThat's a major problem. TMGMT is supposed to manage translation workflows. Sure we need to properly deal with tracking outdated translations.
Comment #16
BerdirThis works fine for me, how did you test?
Comment #17
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedMy 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.