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

Use multiline strings in PO files #114

Open
ScreamingDev opened this issue Jun 12, 2016 · 1 comment
Open

Use multiline strings in PO files #114

ScreamingDev opened this issue Jun 12, 2016 · 1 comment

Comments

@ScreamingDev
Copy link
Contributor

Po-Files can have multiline strings:

#. Description of the plugin/theme
msgid ""
"Twenty Sixteen is a modernized take on an ever-popular WordPress layout — "
"the horizontal masthead with an optional right sidebar that works perfectly "
"for blogs and websites. It has custom color options with beautiful default "
"color schemes, a harmonious fluid grid using a mobile-first approach, and "
"impeccable polish in every detail. Twenty Sixteen will make your WordPress "
"look beautiful everywhere."
msgstr ""

This makes it more readable in the IDE than a looooong single-line string.

@swissspidy
Copy link
Contributor

This would need a multibyte safe wordwrap() function that also preserves trailing whitespace.

I mention whitespace because this:

$string = wordwrap('Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly ', 78);
var_dump(explode("\n", $string));

will result in this:

array(2) {
  [0]=>
  string(75) "Twenty Sixteen is a modernized take on an ever-popular WordPress layout —"
  [1]=>
  string(76) "the horizontal masthead with an optional right sidebar that works perfectly "
}

Note the missing space after the dash.

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

No branches or pull requests

2 participants