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

Comments

Balu Ertl created an issue. See original summary.

baluertl’s picture

Issue summary: View changes
Status: Active » Needs work
cilefen’s picture

Status: Needs work » Active
cilefen’s picture

The br tag appeared in 8.5.0 if my grep-ing is correct.

baluertl’s picture

Assigned: baluertl » Unassigned
Status: Active » Needs review
Issue tags: +Novice
StatusFileSize
new2.1 KB

Patch added as a shamefully-super low-hanging fruit :)

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Assuming bot agrees...

alexpott’s picture

Shouldn'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

gábor hojtsy’s picture

Issue tags: +Needs followup

Both 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?

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 5: 2981169-parsing-error-caused-by-string-5.patch, failed testing. View results

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

baluertl’s picture

Assigned: Unassigned » baluertl

Now ressa also discovered this bug in Danish locale (see their issue referenced). Assigning to myself, to craft a patch next weekend.

ressa’s picture

Since 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 created text, 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!

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

jhodgdon’s picture

Issue tags: -Novice

Not a novice issue any more... Is this still a problem by the way?

ressa’s picture

Status: Needs work » Closed (works as designed)

Thanks 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 [...]

quietone’s picture

Issue tags: -Needs followup

According to #18 this problem has been fixed and by reading the followup asked for in #8 is not needed, removing tag.

ressa’s picture

Version: 9.2.x-dev » 9.4.x-dev
Status: Closed (works as designed) » Needs work

Actually, 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?

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ressa’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs work » Closed (cannot reproduce)

It 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.