Add visual feedback when clicking translate #423
No reviewers
Labels
No labels
a11y
Bug
Bug fix
cannot reproduce
CSS
Documentation
enhancement
Feature
Feature request
Held for next release cycle
Minor change
performance
priority: critical
priority: high
priority: low
priority: medium
priority: patch welcome
regression
Translation/Locale
WIP
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma-fe!423
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ilja/akkoma-fe:provide_visual_feedback_when_clicking_translate_button"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In a status, we can choose to translate the status (assuming there's a translator enabled on the backend).
It will translate, in practice generally according to detected language, and also provide an option to override the source language.
Translating can take a while, and there wasn't really a visual feedback when it was translating.
Now the translate button will be dissabled while translating.
While translating (button is disabled):
When not translating (button is not disabled):
@ -139,0 +139,4 @@this.translating = truethis.$store.dispatch('translateStatus', { id: this.status.id, language: translateTo, from: this.translateFrom }).then(() => { this.translating = false })If my limited JS knowledge doesn’t let me down here, this will lead to
translatinggetting stuck attrueif an error occurs during the dispatch promise. Replacing.then(...)with.finally(...)avoids this, or you may want to add a separate branch for errors to also visually indicate the failureyep you're correct -
.thenisnt' called if the previous branch errorsis fixed now, thk you!
4339f324489838545904