Problem/Motivation
#2454859: Not possible to format plural an already translated string introduced TranslationInterface::formatPluralTranslated and StringTranslationTrait::formatPluralTranslated
#2570107: Make format_plural() return a PluralTranslatableString object to remove reliance on a static, unpredictable safe list removed TranslationInterface::formatPluralTranslated but not StringTranslationTrait::formatPluralTranslated
So, as StringTranslationTrait is widely used in Core, there is a risk that someone tries to use that function that obviously throws a Fatal.
Proposed resolution
Remove StringTranslationTrait::formatPluralTranslated
Remaining tasks
Patch, Review, Commit.
User interface changes
None.
API changes
StringTranslationTrait::formatPluralTranslated will not exist anymore.
Data model changes
None.
RC target triage
That change only removes unused code that would throw a fatal if used by a contrib module. That change is only about code cleanup and is not disruptive at all.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2584797-2.patch | 1 KB | duaelfr |
Comments
Comment #2
duaelfrComment #3
dawehnerGood catch, but by far this is not major.
Comment #4
duaelfrComment #5
jhodgdonThis needs an update to the change record at least, or perhaps a new one.
Comment #6
duaelfrHere is the closest existing change record I found : https://www.drupal.org/node/2571563
I'm not sure it needs to be updated as it's clearly explaining that this method should not be used anymore.
Comment #7
jhodgdonYeah, that's probably OK. Thanks for the research!
Comment #8
gábor hojtsyYeah looks like this is dead code that was not removed recently. From the change notice at https://www.drupal.org/node/2571563 linked by @DuaelFr:
Comment #9
gábor hojtsyComment #10
alexpottDiscussed with @effulgentsia we agree that this is an RC target. It is dead and broken code. The replacement for this is
PluralTranslatableMarkup::createFromTranslatedString(). The issue that introduced this was among the last to be committed during beta and therefore I think it is acceptable to remove during RC.Comment #11
alexpottLess confusing methods added by StringTranslationTrait - nice. Committed 19adf84 and pushed to 8.0.x. Thanks!
Comment #13
gábor hojtsyYay!