Coder Social home page Coder Social logo

Real-time translation updates about pontoon HOT 6 OPEN

mozilla avatar mozilla commented on May 5, 2024
Real-time translation updates

from pontoon.

Comments (6)

bugzilla-to-github avatar bugzilla-to-github commented on May 5, 2024

Comment Author: [email protected]

Because of the ticket regarding the offline mode, I am also very concerned about the problem with the mess that can appear during translation by multiple localizers. So, I decided to accept this task too.

If we do not want to leave ajax behind and start to use websockets (if we want, let me know. I'm in! :)), we cannot get true real time notifications.

As far as I can see, we have two options:

  • send a request for all available translation updates every X seconds/minutes. It looks inappropriate for me in the context of this task. Let me know if you think otherwise.
  • check for updates for particular entity before adding new translation for it
  • if we have no updates, add new translation as usual
  • if updates exist, send a response that contains all required information about them and let a localizer decide what to do: submit new translation anyway or discard it.

Which of these options do you prefer?
How should a localizer be notified about the updates? A dialog with a message and "Keep my translation anyway" and "Cancel my translation" buttons? I clearly see how to implement logic on the client and server sides, but I am not sure about the UI.

from pontoon.

bugzilla-to-github avatar bugzilla-to-github commented on May 5, 2024

Comment Author: @mathjazz

I was actually thinking WebSockets here. :) But if that turns out to be too big of a task, too complicated or what not, we'll have to fallback to AJAX.

As for notifications, I was thinking something like Google Docs / Etherpad:

  1. Simply apply translations in the sidebar and in-place if applicable (also update stats).
  2. In the main toolbar, show a list of users viewing the current locale-project-resource combination. Represent usrs with their profile pictures.

from pontoon.

bugzilla-to-github avatar bugzilla-to-github commented on May 5, 2024

Comment Author: [email protected]

I like the idea about WebSockets too much!
Well, it's decided. I'll play around with it and let you know when I have something to show.

from pontoon.

bugzilla-to-github avatar bugzilla-to-github commented on May 5, 2024

Comment Author: :Gijs (back Sept 20; he/him) <[email protected]>

FWIW, before websockets the way you used to do this was "long polling" - you'd keep a single ajax request open to the server at all times. The server would just not write a response until it had one, or until about 50-55 seconds had passed (after 1 minute, all kinds of software/firewalls/whatever starts killing TCP things, so you want to make sure you're done before then). If it "timed out", the server would just tell you "no updates!" and otherwise it would be able to write updates to the client listening for them essentially in real time. Once the request returned, the client would just restart the same "poll" request and you'd continue like that. I'm just dropping by via Matjaz' blogpost, so I'm not sure what language is involved here and how you'd do this in that language. :-)

from pontoon.

bugzilla-to-github avatar bugzilla-to-github commented on May 5, 2024

Comment Author: @Osmose

Peterbe did something similar to what's being proposed here using fanout.io: https://air.mozilla.org/webdev-beer-and-tell-august-2015/#@15m44s

from pontoon.

bugzilla-to-github avatar bugzilla-to-github commented on May 5, 2024

Comment Author: @mathjazz

See also:
https://www.peterbe.com/plog/using-fanout.io-in-django
https://devcenter.heroku.com/articles/websockets

from pontoon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.