Problem/Motivation
There is a new UI string (ID#2651490 on l.d.o) appeared in 8.6.x :
No front page content has been created yet.<br/>Follow the <a target=\"_blank\" href=\"https://www.drupal.org/docs/user_guide/en/index.html\">User Guide</a> to start building your site.
Basically, I welcome the idea to point admins of freshly-installed Drupal sites to the User Guide frontpage, which are now being translated into a dozen of languages, so the link target URL can be localized as well. Great!
However, when the l10n_update module imports the .po files, then this string causes parsing error with its HTML line break element <br/> between its two sentences. As far as I tested out with two .po files containing only this string alone, I found that the per sign ("/")
As it can be seen the German localization team solved the issue by simply removing the "/" char from their translation. In Hungarian I also submitted an other variant to see whether it will seamlessly import next time?
Proposed resolution
Regarding MDN writes in the "Tag omission" section:
"Must have a start tag, and must not have an end tag. In XHTML documents, write this element as
<br />".
So the proper format of this HTML element is with an extra space before the per sign, so I plan to attach a patch to remove it from the string.
Remaining tasks
Discuss, Agree, Code, Patch, Commit, Documentate.
User interface changes
No visible changes on UI.
API changes
n.a.
Data model changes
n.a.
OS: Ubuntu 16.04 LTS
Web server: nginx 1.13.12
PHP: 7.1.17 (mem.limit: 512M)
Drupal: 8.5.3
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2981169-parsing-error-caused-by-string-5.patch | 2.1 KB | baluertl |
Comments
Comment #2
baluertlComment #3
cilefen commentedI related #2907348: Enable new users to learn about the user guide.
Comment #4
cilefen commentedThe br tag appeared in 8.5.0 if my grep-ing is correct.
Comment #5
baluertlPatch added as a shamefully-super low-hanging fruit :)
Comment #6
jhodgdonAssuming bot agrees...
Comment #7
alexpottShouldn't we update the l10n_update module module to be a bit more liberal in what it accepts? That doesn't mean we shouldn't do this but it feels that that module should be more mindful of https://en.wikipedia.org/wiki/Robustness_principle
Comment #8
gábor hojtsyBoth the space and the slash are optional in HTML5. Drupal core itself generates meta, link, etc. tags with a space and a slash. I agree it would be nice to fix the update core (also in core in 8.x and not a contrib module) to be more liberal in trying to protect the site from XSS. Can you submit an issue with the error @Balu Ertl?
Comment #11
baluertlNow ressa also discovered this bug in Danish locale (see their issue referenced). Assigning to myself, to craft a patch next weekend.
Comment #12
ressaSince a patch to update the l10n_update module hasn't been created so far, can't we at least update the
No front page content has been createdtext, to use well-formatted<br />?I also just had a run-in with this problem #3011843: Malformed HTML skips import of string, and like the German localization team, I also solved it by removing the slash. I just don't think we need to let more translators get hit by this.
EDIT: I should have refreshed before posting, but it sounds good @Balu Ertl, thanks!
Comment #17
jhodgdonNot a novice issue any more... Is this still a problem by the way?
Comment #18
ressaThanks for following up on this @jhodgdon. I just updated the string, and it accepted the version below with
<br/>as well as with<br />, so the problem must have been fixed at some point:Der er ikke oprettet noget indhold på forsiden endnu.<br/>Læs [...]Comment #19
quietone commentedAccording to #18 this problem has been fixed and by reading the followup asked for in #8 is not needed, removing tag.
Comment #20
ressaActually, sadly I still see this:
[error] Import of string "Der er ikke oprettet noget indhold på forsiden endnu.<br/>Læs <a target="_blank" href="https://www.drupal.org/docs/user_guide/en/index.html">manualen</a> for at komme i gang med at bygge din hjemmeside." was skipped because of disallowed or malformed HTML.I am not sure what the next step is to fix this ... Did you have a chance to take a look at the issue back in 2018 @Balu Ertl?
Comment #22
ressaIt looks like this been fixed, by updating the strings on the front page, splitting them up:
<em>You haven’t created any frontpage content yet.</em>https://localize.drupal.org/translate/languages/da/translate?sid=2895189
Congratulations and welcome to the Drupal community.https://localize.drupal.org/translate/languages/da/translate?sid=2814522
I no longer see this issue in Drupal 10.1, and am closing this issue.