- 🇳🇿New Zealand quietone
Tagging for coding standards and moving to the 'other' component where such issues live.
- Status changed to Needs review
almost 2 years ago 6:58am 3 February 2023 - 🇮🇳India chaitanyadessai Goa
Removed t() calls from setLabel() and setDescription().
- Status changed to Needs work
almost 2 years ago 2:54pm 21 February 2023 - 🇺🇸United States smustgrave
@chaitanyadessai please include an interdiff with your patches
Doing a search for ->setLabel(t(
Showed more instances from test files I don't think are related to revisionsSame for setDescription
- Status changed to Needs review
almost 2 years ago 5:36am 23 February 2023 - Status changed to RTBC
almost 2 years ago 7:38pm 23 February 2023 - 🇺🇸United States smustgrave
Seems all instances have been removed. So guess we weren't testing translation of either of those. Should we open a follow up to add testing?
- Status changed to Needs work
almost 2 years ago 8:44pm 23 February 2023 - 🇬🇧United Kingdom longwave UK
This still needs discussion as to whether we should actually do it, as per #14 through #18.
- Status changed to Needs review
12 months ago 11:38pm 20 December 2023 - 🇬🇧United Kingdom longwave UK
Thinking this through some more after working on the final t() removals in tests in 📌 Remove remaining unnecessary uses of t() in tests Active , I now think this is won't fix - we need test coverage of TranslatableMarkup passed through to various common APIs like render, form and field API and test coverage should provide good examples to use as well.
Marking "needs review" for this comment, hiding all other patches.
- 🇬🇧United Kingdom longwave UK
Explaining a bit further:
In real-world implementations of
setLabel()
and similar methods we uset()
. By removingt()
in tests we are not really testing the same way a real-world implementation would, if we only used raw strings in tests then how would be sure that the code actually works with translatable strings?Also, tests are sometimes used as examples of features and the code is copy-pasted and then edited and used for real. If we drop
t()
here we risk people copy-pasting and not following the best practice of adding translatable labels and descriptions.It's similar to when we have a test form. In most test form implementations we still wrap form element labels in
t()
because that's what a real world implementation of a form should do. - Status changed to Closed: won't fix
12 months ago 2:31pm 21 December 2023 - 🇺🇸United States smustgrave
Explanation makes sense, anyone really disagrees please reopne.