Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Make flash message showing "DeepL Usage" configurable (or at least do not show it beneath some threshold) #343

Open
sypets opened this issue Jun 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sypets
Copy link
Contributor

sypets commented Jun 26, 2024

This is not a huge problem, but is a little annoying.

Is your feature request related to a problem? Please describe.

Flash messages with usage appear when elements are translated. This is IMHO unnecessary:

  • for non-admins (I do not want to bother them with this at all. The usage is monitored and there is currently no need for editors to worry about it)
  • if current usage is way below limit

image

Also, for some reason the message sometimes appears twice. It also appears for non-admin editors. This is an inline message, so it does not disappear without reload.

Describe the solution you'd like

  • make this configurable if this should be displayed at all and if only for admins and also non-admins
  • and make the threshold configurable, e.g. 80%
  • also, the string is not localized

Additional context

We have a paid account with DeepL with a limit. I already have functionality to see the usage, including seeing this in TYPO3 BE:

image

Versions

  • wv_deepltranslate: latest master / main
  • TYPO3: latest v11 release: 11.5.38
@sypets sypets added the enhancement New feature or request label Jun 26, 2024
@pixelbrackets
Copy link
Contributor

As an editor I should see relevant information only. A 4% usage limit is not relevant. With the great PR #338 this is something integrators or chief editors can keep an eye on.

Suggestion: The warning message could appear after a certain threshold, like 80% or 90%. And an error should appear when the limit is exceeded.

pixelbrackets added a commit to pixelbrackets/typo3-wv_deepltranslate that referenced this issue Sep 9, 2024
pixelbrackets added a commit to pixelbrackets/typo3-wv_deepltranslate that referenced this issue Sep 9, 2024
Calculate the message severity based on the API quota usage rate.
Matching popular quota warning levels if will notify above 90% usage,
and shown an error when the limit is exceeded.

Hide the flashmessage after a translation if the severity is low.

Refs web-vision#343
pixelbrackets added a commit to pixelbrackets/typo3-wv_deepltranslate that referenced this issue Oct 19, 2024
pixelbrackets added a commit to pixelbrackets/typo3-wv_deepltranslate that referenced this issue Oct 21, 2024
pixelbrackets added a commit to pixelbrackets/typo3-wv_deepltranslate that referenced this issue Oct 21, 2024
Calculate the message severity based on the API quota usage rate.
Matching popular quota warning levels if will notify above 90% usage,
and shown an error when the limit is exceeded.

Hide the flashmessage after a translation if the severity is low.

Refs web-vision#343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants