Add visual feedback when clicking translate #423
No reviewers
Labels
No labels
a11y
Bug
Bug fix
Critical Priority
Documentation
Feature
Feature request
Held for next release cycle
High Priority
Low Priority
Medium Priority
Minor change
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…
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 = true
this.$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
translating
getting stuck attrue
if 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 -
.then
isnt' called if the previous branch errorsView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.