diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index 418b71bb97..bb6cd3b4bb 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -61,6 +61,10 @@ export default { }, computed: { changesBadge() { + // `hasChanges` provides the state for all other than the current + // translation from the backend; for the current translation we need to + // check `content.hasChanges` as this state can change dynamically without + // any other backend request that would update `hasChanges` if (this.hasChanges || this.$panel.content.hasChanges) { return { theme: this.$panel.content.lock.isLocked ? "red" : "orange" diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index f8d02a9dd4..26d9775b35 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -43,8 +43,8 @@ class: 'k-languages-dropdown', /** * Returns if any translation other than the current one has unsaved changes - * (the current will be considered dynamically in `` - * based on its state) + * (the current language has to be handled in `k-languages-dropdown` as its + * state can change dynamically without another backend request) */ public function hasChanges(): bool {