Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
A callback (containing the translation) can fail.
Customers should be able to pull the translation on click... or a translation update.
Add a button per job or/and per job item to pull the translation (again) from OHT.
Overwrite the text field if not #customized (future feature of tmgmt core).
Comment | File | Size | Author |
---|---|---|---|
#12 | add_pull_translation-1899670-12.patch | 4.57 KB | mbovan |
#9 | add_pull_translation-1899670-9-interdiff.txt | 4.92 KB | mbovan |
#9 | add_pull_translation-1899670-9.patch | 5.35 KB | mbovan |
#7 | add_pull_translation-1899670-7-interdiff.txt | 4.28 KB | mbovan |
#7 | add_pull_translation-1899670-7.patch | 4.08 KB | mbovan |
Comments
Comment #1
miro_dietikerCore related #1969434: Poll / Pull translator button
Comment #2
miro_dietikerWe defined that a pull button is a minimum requirement for QA in all TSP plugins.
Comment #3
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedAdded a "Pull translations" button.
Not sure about error/status messages...
Comment #4
Berdirin here, use the addMessage() stuff, not wtachdog for those errors.
It would also be weird if we show a successfull message at the end when there were errors. this should possibly have a boolean return value or maybe we should just do the addMessage() on the job here if there are no errors.
Comment #5
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedTried to improve it with this patch...
Comment #6
miro_dietikerOnce array() once [].
It does not show the message. It adds a message to the item..
Also if i remember right, we usually report some more data to the message such as data length.
But anyway, why not logging the information to the item message if pull button updates it?
The only thing is, we need to know if there was an update at all to avoid duplicate messages on multiple button press. All in all, the API reads a bit limited...
Poll or pull? :-)
The %label seems to be a duplicate information. Note that you add the message to the job item already! Anything else is of more value.
Comment #7
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedRe #6:
1. Changed to array() :)
2/3. These messages are improved in #1918168: When translation is updated the message created should be appropriate. We added $error variable just to know in what case to display messages in
drupal_set_message()
. It seems it adds additional overhead so I removed the variable, attaching the messages to job items (in any case). Indrupal_set_message()
we are displaying general messages and for more info there is "Messages" section.4. Agreed with @Berdir that "Pull translations" is better UI, but changed to "Poll" to be consistent with other translators.
5. Removed unnecessary labels.
Comment #8
BerdirI think we should consistently use pull, not poll. I've always found the usage of poll in mygengo confusing, no need to be consistent with something that's not good :)
Hm. I don't think the fact that there are no translations yet is an error. I simply wouldn't log anything in this case. This is an expected scenario.
If anything, then we should possibly provide a summary at the end, something like "Fetched translations for X job items, Y are not yet translated".
Which I think we could do as a message on the job, which we can then display with the function that I mentioned, instead of the true/false return, we wouldn't need that anymore I think.
Comment #9
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedChanged to "Pull" and improved a message based on comment #8.
Comment #11
BerdirThat works for me. We'll need to update the code in 8.x-1.x too, which is based on the previous patch.
Comment #12
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedPorted a patch to D8.
There are some improvements that we can make - e.g. use
formatPlural()
for the message, as it can be "Fetched translations for 1 job items.".Should I add it here?
Comment #13
BerdirNo. format plural can't handle two numbers anyway and we do our own translation. That would translate it in the current interface language and then every user would see it in that when looking at the log.
Comment #14
BerdirCommitted, thanks.