Skip to content

Implement translation for text blocks #192

Description

@vitonsky

Currently we translate a DOM nodes, so translator may be called multiple times with something like

  • hello
  • world
  • how
  • are
  • u

This behaviour leads to bad translation results due to lack of context.

We should improve the API to handle text blocks together so call translation for hello world how are u.

Requirements

  • All text nodes in one block element must be passed to a translator
  • Each text node must be a unit of translation. So nodes may be translated separately, but in one context
  • The text block must be as small as possible. For example an one p element or div or anything. But it must not be a body or any other block element that contains another block elements.

There are still questions to research and answer

  • How to handle anything like <div>A <div>quick brown</div> fox <p>jumps over</p> a lazy dog? Here we have a small block containers like <div>quick brown</div> and <p>jumps over</p>, but its have no own context. How to handle it? What a formal rule to handle fine this case and trivial cases with large texts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions