Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Markdown and HTML translation #25

Closed
3 tasks done
Tracked by #1
sargreal opened this issue Oct 27, 2022 · 4 comments
Closed
3 tasks done
Tracked by #1

Advanced Markdown and HTML translation #25

sargreal opened this issue Oct 27, 2022 · 4 comments
Assignees
Labels
Milestone

Comments

@sargreal
Copy link
Member

sargreal commented Oct 27, 2022

Rationale

Markdown is not officially supported by DeepL, so there are sometimes issues with the translation. In particular the following issues have been discovered:

  • non-absolute link targets are sometimes translated
  • Text formatting sometimes removed (** at the end of lines)

Also some people use not Markdown in the richtext fields, but HTML (for example with the HTML editor or CK Editor), so this should not be translated but directly interpreted as HTML

Approach

DeepL supports xml tag filtering and beta HTML support, so HTML should work well and Markdown could be parsed to HTML and back.

  • Configuration of the behaviour
    For each field type allow adding settings either with string or with object of shape {type: string, format: 'plain' | 'markdown' | 'html'}
  • parse markdown to html and back (watching out for custom syntax!)
  • send html in separate requests with deepl api and with option tag_handling=html
@sargreal sargreal mentioned this issue Oct 27, 2022
15 tasks
@sargreal sargreal changed the title Advanced Markdown and HTML translation (DeepL supports xml tag filtering, so HTML should work well and Markdown could be parsed to HTML and back -> Configuration of the behaviour required) Advanced Markdown and HTML translation Oct 27, 2022
@sargreal sargreal added the enhancement New feature or request label Oct 27, 2022
@sargreal sargreal added this to the v1.0 milestone Oct 28, 2022
@sargreal sargreal self-assigned this Nov 11, 2022
sargreal added a commit that referenced this issue Nov 11, 2022
Since some providers do not handle Markdown or HTML out of the box, this feature enables the
configuration and handling of different text formats.
There are 3 different formats defined: plain,
markdown and html.
On translation fields are grouped by their format and submitted per format to
the provider.
Providers can either translate the text in the respective format or optionally parse
them to a format supported by them. There is a new service defined, that allows the parsing between
html and markdown.

BREAKING CHANGE: Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string

fix #25
sargreal added a commit that referenced this issue Nov 11, 2022
Since some providers do not handle Markdown or HTML out of the box, this feature enables the
configuration and handling of different text formats.
There are 3 different formats defined: plain,
markdown and html.
On translation fields are grouped by their format and submitted per format to
the provider.
Providers can either translate the text in the respective format or optionally parse
them to a format supported by them. There is a new service defined, that allows the parsing between
html and markdown.

BREAKING CHANGE: Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string

fix #25
sargreal added a commit that referenced this issue Nov 12, 2022
Since some providers do not handle Markdown or HTML out of the box, this feature enables the
configuration and handling of different text formats.
There are 3 different formats defined: plain,
markdown and html.
On translation fields are grouped by their format and submitted per format to
the provider.
Providers can either translate the text in the respective format or optionally parse
them to a format supported by them. There is a new service defined, that allows the parsing between
html and markdown.

BREAKING CHANGE: Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string

fix #25
sargreal added a commit that referenced this issue Nov 12, 2022
Since some providers do not handle Markdown or HTML out of the box, this feature enables the
configuration and handling of different text formats.
There are 3 different formats defined: plain,
markdown and html.
On translation fields are grouped by their format and submitted per format to
the provider.
Providers can either translate the text in the respective format or optionally parse
them to a format supported by them. There is a new service defined, that allows the parsing between
html and markdown.

BREAKING CHANGE: Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string

fix #25
@sargreal
Copy link
Member Author

Closing this since implementation merged into next

sargreal added a commit that referenced this issue Nov 12, 2022
Since some providers do not handle Markdown or HTML out of the box, this feature enables the
configuration and handling of different text formats.
There are 3 different formats defined: plain,
markdown and html.
On translation fields are grouped by their format and submitted per format to
the provider.
Providers can either translate the text in the respective format or optionally parse
them to a format supported by them. There is a new service defined, that allows the parsing between
html and markdown.

BREAKING CHANGE: Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string

fix #25
@sargreal sargreal mentioned this issue Nov 12, 2022
Merged
2 tasks
fekide-bot pushed a commit that referenced this issue Nov 13, 2022
# strapi-provider-translate-deepl 1.0.0-next.1 (2022-11-13)

### Features

* handle format of text field types ([94570e0](94570e0)), closes [#25](#25)
* **provider system:** use a provider system, renames the plugin to strapi-plugin-translate ([dcde4af](dcde4af)), closes [#30](#30) [#26](#26)
* **setup:** parse default environment variables ([da79089](da79089))

### BREAKING CHANGES

* Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string
* **provider system:** Rename plugin to strapi-plugin-translate

### Dependencies

* **strapi-plugin-translate:** upgraded to 1.0.0-next.1
fekide-bot pushed a commit that referenced this issue Nov 13, 2022
# 1.0.0-next.1 (2022-11-13)

### Bug Fixes

* 413 Error when fields are too large ([f9f1f4a](f9f1f4a))
* do not translate localizations ([351156c](351156c))
* function formatComponentData was renamed in helper-plugin ([adc2637](adc2637))
* show deepl section only with appropriate permissions ([093cec4](093cec4))

### Features

* **admin:** update translate icon ([9bf1c07](9bf1c07))
* handle format of text field types ([94570e0](94570e0)), closes [#25](#25)
* **provider system:** use a provider system, renames the plugin to strapi-plugin-translate ([dcde4af](dcde4af)), closes [#30](#30) [#26](#26)
* **setup:** parse default environment variables ([da79089](da79089))

### BREAKING CHANGES

* Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string
* **provider system:** Rename plugin to strapi-plugin-translate
@fekide-bot
Copy link

🎉 This issue has been resolved in version 1.0.0-next.1 🎉

The release is available on npm package (@next dist-tag)

Your semantic-release bot 📦🚀

@fekide-bot
Copy link

🎉 This issue has been resolved in version 1.0.0-next.1 🎉

The release is available on npm package (@next dist-tag)

Your semantic-release bot 📦🚀

fekide-bot pushed a commit that referenced this issue Jan 6, 2023
# strapi-provider-translate-deepl 1.0.0 (2023-01-06)

### Features

* handle format of text field types ([94570e0](94570e0)), closes [#25](#25)
* **provider system:** use a provider system, renames the plugin to strapi-plugin-translate ([dcde4af](dcde4af)), closes [#30](#30) [#26](#26)
* **setup:** parse default environment variables ([da79089](da79089))

### BREAKING CHANGES

* Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string
* **provider system:** Rename plugin to strapi-plugin-translate

### Dependencies

* **strapi-plugin-translate:** upgraded to 1.0.0
fekide-bot pushed a commit that referenced this issue Jan 6, 2023
# 1.0.0 (2023-01-06)

### Bug Fixes

* 413 Error when fields are too large ([f9f1f4a](f9f1f4a))
* build issue with strapi <4.5 ([702c058](702c058)), closes [#38](#38)
* do not translate localizations ([351156c](351156c))
* function formatComponentData was renamed in helper-plugin ([adc2637](adc2637))
* make strapi name lowercase ([d71bdf6](d71bdf6))
* populate media in direct translation ([7b803d6](7b803d6))
* relations not translated in normal mode ([1b5327c](1b5327c)), closes [#35](#35)
* relations not translated in normal mode ([15673fe](15673fe)), closes [#35](#35)
* show deepl section only with appropriate permissions ([093cec4](093cec4))

### Features

* **admin:** remove tabs for now ([c0d587c](c0d587c))
* **admin:** update translate icon ([9bf1c07](9bf1c07))
* handle format of text field types ([94570e0](94570e0)), closes [#25](#25)
* **provider system:** use a provider system, renames the plugin to strapi-plugin-translate ([dcde4af](dcde4af)), closes [#30](#30) [#26](#26)
* **setup:** parse default environment variables ([da79089](da79089))

### BREAKING CHANGES

* Translate service api requires array of objects of shape
{field:string,format:string} instead of just the field as string
* **provider system:** Rename plugin to strapi-plugin-translate
@fekide-bot
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants