mozilla / pontoon

Mozilla's Localization Platform
https://pontoon.mozilla.org
BSD 3-Clause "New" or "Revised" License
1.47k stars 530 forks source link

Real-time translation updates #2013

Open bugzilla-to-github opened 10 years ago

bugzilla-to-github commented 10 years ago

This issue was created automatically by a script.

Bug 1088724

Bug Reporter: @mathjazz CC: gijskruitbosch+bugs@gmail.com, @Jobava, @Osmose, sandra.shklyaeva@gmail.com, @zbraniecki

If multiple localizers are working on the same project/resource, they should see translation updates right after they are submitted to avoid duplicating work.

bugzilla-to-github commented 9 years ago

Comment Author: sandra.shklyaeva@gmail.com

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:

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.

bugzilla-to-github commented 9 years ago

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.
bugzilla-to-github commented 9 years ago

Comment Author: sandra.shklyaeva@gmail.com

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.

bugzilla-to-github commented 9 years ago

Comment Author: :Gijs (back Sept 20; he/him) <gijskruitbosch+bugs@gmail.com>

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. :-)

bugzilla-to-github commented 9 years ago

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

bugzilla-to-github commented 7 years ago

Comment Author: @mathjazz

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