Skip to content

Translation #5

@marktnoonan

Description

@marktnoonan

Here's one set of guidelines for how translation could work in the project

  • Translation is only available when a live transcript is public, and happens on the Observe.html page but never the main live transcript. That should always be in the speaker's language, because:
  • Translations will happen at the level of lines themselves, that Yandex has some context for how to translate each word. Edits to the original transcript should cause the entire line containing that word to be retranslated on the observer's page.
  • When translation is turned on, we need to add the credit "Powered by Yandex.Translate" on the screen, per these guidelines: https://tech.yandex.com/translate/doc/dg/concepts/design-requirements-docpage/
  • This will create a lot of API calls to Yandex, and maybe when a line has been translated, we should cache it in the database until some word within it is edited and then cache the new translation. But this would possibly create an even greater impact in terms of firebase calls because we'd have to increase the nesting to provide multiple languages at the "line" level... so it is too soon to worry about this.

The UI things we need for translation on the observe.html page would be:

  1. Dropdown listing all languages supported by Yandex
  2. "Translate" toggle.

The JS functionality we need is:

  1. Track what target language is selected.
  2. Track the source language. This is not currently declared on the main input page, but should be. Web Speech Recognition API just needs to be told what language it is listening to, and it will do so. So we have to gather, and store that info. Or Yandex can guess.
  3. Track whether we are currently translating or not.
  4. If we are translating, grab incoming lines from the DB and make the API call to Yandex for each line.
  5. Insert the results from the Yandex call into the same span elements we are using for snippets when not translating.
  6. If translation is turned off, skip all the yandex stuff, but do not go back and update content that was already translated. New stuff just gets handled as normal.

This seems like a good starting point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions