nginxconfig.io icon indicating copy to clipboard operation
nginxconfig.io copied to clipboard

"Copy a base64 string of the compressed config" translation bug

Open 5idereal opened this issue 2 years ago • 2 comments

Information

Browser Info

Details

Description

The translation for "Copy a base64 string of the compressed config" will revert to English after clicked. Also, the "Copied" text isn't translatable.

Steps to reproduce

Scroll down to Download section and "click on the Copy a base64 string of the compressed config" link.

Expected behavior

Keep the translation after clicking.

Screenshots

Animation

5idereal avatar Jun 15 '22 07:06 5idereal

Ah! Good catch. I think this logic is responsible for this:

https://github.com/digitalocean/nginxconfig.io/blob/479162576d291d2c930ba37cf322af56ff5dd307/src/nginxconfig/templates/setup.vue#L152-L175

Instead of setting originalText when this method is first called, we probably want to look at trying to store the original text right before the text change occurs (either in the existing success hook where it's changed to "copied", or in an earlier hook if ClipboardJS provides it).

And then the "copied" text just needs to use the translation API (this.$t) instead of being a plain string.

MattIPv4 avatar Jun 15 '22 11:06 MattIPv4

Replacing the text makes the whole sentence looks weird.

or, Copied, paste it in your server's command line and execute it.

Maybe It's better to show a tooltip instead. Like this. image

5idereal avatar Jun 15 '22 11:06 5idereal

@MattIPv4 I'd like to work on this issue. Please, can you assign it to me?

raulsoledispa avatar Sep 28 '22 21:09 raulsoledispa

Sure thing :)

MattIPv4 avatar Sep 28 '22 21:09 MattIPv4