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

Verse: Block example should be a single string for translators to handle #18364

Closed
mcsf opened this issue Nov 7, 2019 · 1 comment · Fixed by #18372
Closed

Verse: Block example should be a single string for translators to handle #18364

mcsf opened this issue Nov 7, 2019 · 1 comment · Fixed by #18372
Labels
[Block] Verse Affects the Verse block Internationalization (i18n) Issues or PRs related to internationalization efforts

Comments

@mcsf
Copy link
Contributor

mcsf commented Nov 7, 2019

Context

See context for block examples:

Issue

Currently, the example for the Verse block is made up of distinct translatable strings:

example: {
attributes: {
content: __( 'WHAT was he doing, the great god Pan,' ) + '<br>' +
__( ' Down in the reeds by the river?' ) + '<br>' +
__( 'Spreading ruin and scattering ban,' ) + '<br>' +
__( 'Splashing and paddling with hoofs of a goat,' ) + '<br>' +
__( 'And breaking the golden lilies afloat' ) + '<br>' +
__( ' With the dragon-fly on the river.' ),
},
},

This harms the translating experience greatly, as becomes clear by looking up any of its verses in GlotPress (see Portuguese (Portugal) for instance):

  • Translators need to find verses separately
  • Translators need to make sense of them and understand the context of each string
  • Translators are bound to translating each verse independently

As a consequence, translators lose the freedom to adapt rather than translate, i.e. free themselves from a verse-by-verse translation — which is a difficult to do and of low value to users of that locale — and possibly provide a comparable block example that is fitting of the locale at hand, such as a local poem.

Solutions

The motivation to keep verses separate may have come from the fact that they need to be stitched with HTML, namely the line breaks (<br>). In the broader Gutenberg codebase, this is an internalisation challenge requiring element interpolation that is tracked in #9846.

However, when dealing with block examples, we are in the unusual case of translating not UI, not code in a stricter sense, but serialised data representing user content. Thus, the example strings can in fact contain HTML elements. In fact, I'd argue that this is the most correct thing to do, as it fits the idea that we're letting content be translated.

Questions: What care should be exercised in such a scenario? Should we beware of ill-intentioned translators seeking to inject unexpected content?

/cc @swissspidy and anyone you'd like to add to the conversation

@mcsf mcsf added Internationalization (i18n) Issues or PRs related to internationalization efforts [Block] Verse Affects the Verse block labels Nov 7, 2019
@mcsf
Copy link
Contributor Author

mcsf commented Nov 7, 2019

However, when dealing with block examples, we are in the unusual case of translating not UI, not code in a stricter sense, but serialised data representing user content. Thus, the example strings can in fact contain HTML elements. In fact, I'd argue that this is the most correct thing to do, as it fits the idea that we're letting content be translated.

Explored in #18365.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Verse Affects the Verse block Internationalization (i18n) Issues or PRs related to internationalization efforts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant