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

(i18n) Verse: Example: Fix string concatenation, add translators string #18365

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

mcsf
Copy link
Contributor

@mcsf mcsf commented Nov 7, 2019

Description

See #18364 for full context. In particular, this pull request explores the following point:

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.

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

ellatrix commented Nov 7, 2019

Hm, why are we adding line break elements vs. using \n?

@ellatrix
Copy link
Member

ellatrix commented Nov 7, 2019

Now that I look closer, it looks like this block is could use the same logic as Preformatted to replace line breaks.

@ellatrix
Copy link
Member

ellatrix commented Nov 7, 2019

What do you think about #18372?

@mcsf
Copy link
Contributor Author

mcsf commented Nov 7, 2019

Thanks for jumping in.

What do you think about #18372?

I don't have a preference, only the sense that one change is more complex than the other. Do you see a strong reason against using <br>? Or did you mean to fix Verse to allow \n regardless of the block example issue?

@ellatrix
Copy link
Member

ellatrix commented Nov 7, 2019

It depends how you see it. The change is slightly (?) more complex, but the benefit is that it's less complex to translate (don't have to deal with line break elements), what is saved is less complex, it's less complex to edit the HTML in the HTML editor, and it would make the implementation the same as the Preformatted block.

@mcsf
Copy link
Contributor Author

mcsf commented Nov 7, 2019

Those all make sense, but especially the parallels with Preformatted. We can go with your PR.

@ellatrix
Copy link
Member

ellatrix commented Nov 7, 2019

Ah, parallel. That's the word I was looking for. :)

@ellatrix
Copy link
Member

ellatrix commented Nov 7, 2019

But I don't mind doing this first and then the other. It doesn't really matter. :)

@mcsf
Copy link
Contributor Author

mcsf commented Nov 7, 2019

Thanks for the review! Will circle back to #18372.

@mcsf mcsf merged commit 8f92b64 into master Nov 7, 2019
@mcsf mcsf deleted the fix/i18n-verse-example branch November 7, 2019 19:09
@youknowriad youknowriad added this to the Gutenberg 6.9 milestone Nov 11, 2019
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 this pull request may close these issues.

3 participants