One request per div = too many

  • Issue description:
    On an Angular project with custom components : I have a page with more than an hundred div to be translated, it seems every div generates a request so it ends up with too many and very slow. Is there a way to have only one request per page ?

  • Link to the page with the widget in question:

2 Likes

Hi there and welcome to the Community, @user24364 :waving_hand:

Basically, our widget doesn’t send a translation request for every single div. Instead, it collects all the phrases and sends them in one request.

However, the issue occurs because of the dynamic elements on your page, which appear after the widget load. So, once the widget sees these dynamic elements, it collects the new text and translates it again and, unfortunately, there’s nothing can be done with it.

I hope this explains things.

If you have any questions left or any assistance is needed, we’ll be delighted to help :slightly_smiling_face:

2 Likes

Merci Max !
But then our Angular app would need to unload Elfsight on every page (route) and load it again only when all content is displayed. Which is hacky and user would loose its “Chinese” or “French” preference.
Is there any prop and method in your API that would allow so ? Something like :

  • triggerAutomatically=false property
  • sendTextToTranslate() method

to handle it manually and trigger the sending of text to your server only in one block when our page is laoded ?
ThxX

1 Like

I am really sorry, but there’s nothing can be done with it :slightly_smiling_face:

If we make the widget load after all the dynamic content, but this would worsen the UX because the jump in translating all phrases would then become very noticeable.

Also, if you have dynamic elements that appear on scroll, they’ll still be translated again.

I hope this explains things.

If you have any questions left or any assistance is needed, we’ll be happy to help :wink:

1 Like