Postponed on #2454859: Not possible to format plural an already translated string.

Problem/Motivation

In #2454859: Not possible to format plural an already translated string we found that formatPlural() is not fully tested in relation to its use of SafeMarkup. formatPlural() was marking each string as safe regardless of whether the replacement values were safe or not.

Proposed resolution

Add tests.

Remaining tasks

Add tests.

User interface changes

None.

API changes

None.

CommentFileSizeAuthor
#4 2455739-4.patch2.31 KBmaxocub

Comments

jhodgdon’s picture

Status: Postponed » Active

Other issue was committed, so this is un-postponed.

maxocub’s picture

I'd like to work on that if no one already is.

gábor hojtsy’s picture

Please do!

maxocub’s picture

Status: Active » Needs review
StatusFileSize
new2.31 KB

I modified the formatPlural() test by adding one assert to check if the string is expected to be safe and I added some data in the provider.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests +sprint

Looks good to me. Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed d7cb696 and pushed to 8.0.x. Thanks!

  • alexpott committed d7cb696 on 8.0.x
    Issue #2455739 by maxocub: formatPlural() is not fully tested for...
alexpott’s picture

Nice @maxocub! first commit credit to Drupal core is a solo effort :)

gábor hojtsy’s picture

Indeed, @maxocub++

gábor hojtsy’s picture

Issue tags: -language-base, -sprint +language-ui

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

maxocub’s picture

maxocub’s picture