tolgee / tolgee-platform

Developer & translator friendly web-based localization platform
https://tolgee.io
Other
1.9k stars 197 forks source link

Translations pushed from figma plugin are not treated the same way as when updated manually #2400

Closed stepan662 closed 3 weeks ago

stepan662 commented 3 months ago

When pushing from figma plugin (endpoint /v2/projects/keys/import-resolvable), it doesn't trigger automatic actions - like auto translations and neither are other translations marked as deprecated (in case of base language)

JanCizmar commented 2 months ago

@huglx now has good experience with the automation debugging, so I've assigned him.

huglx commented 2 months ago

Hi @stepan662, I was working on this issue for a while and reached a few conclusions: First, on my local machine, I didn't notice anything wrong with the autotranslation staff. Could you describe more about reproducing this issue? Regarding deprecated translations, there was a missing part of the code that should mark the translation as outdated upon import, and I have added that code.

stepan662 commented 2 months ago

Isn't it the same issue? When I try this on production, translations don't get marked as outdated neither autotranslated. https://github.com/user-attachments/assets/b4a1e5da-f677-4f36-b139-c068a04ec465

huglx commented 2 months ago

On your video, you don't have an auto-translation flag icon for Czech translation, which is why it isn't translated. This happens when you have manually modified a translation. And the problem with outdate thing I've resolved.

huglx commented 2 months ago

Ok, it doesn’t work if I pulled the key and then modified it, but I guess there is a problem with the auto-translation flag nearby a translation, not with automation itself, because it works fine if I push a new key to Tolgee.

huglx commented 2 months ago

Maybe we should add the ability to turn on auto-translation for a certain language when the user has somehow turned it off (like removing the auto-translation icon, etc.).

stepan662 commented 2 months ago

Ah, you are right it's not supposed to work when there is already a translation (non autotranslated), but it still doesn't work even if I delete it https://github.com/user-attachments/assets/4a65defc-efa2-446f-8ecc-353bf92efa86

stepan662 commented 2 months ago

Aha, it works, you are right. I forgot about this option 🤦 Snímek obrazovky 2024-08-22 v 16 12 15

huglx commented 2 months ago

great, so I only fix outdate states behaviour

stepan662 commented 2 months ago

Please add option to FORCE_OVERRIDE, which will forcefully update/create/keeps the translation to the new value.

So it's not necessary to know upfront which action has to be done.

JanCizmar commented 4 weeks ago

@huglx what's the state of this?

huglx commented 4 weeks ago

@huglx what's the state of this?

im working on it