
Problem/Motivation
Advanced descriptions for field type purpose are still not translateable on /admin/structure/types/manage/article/fields/add-field although they are marked as translation like this:
**
* Plugin implementation of the 'text' field type.
*
* @FieldType(
* id = "text",
* label = @Translation("Text (formatted)"),
* description = {
* @Translation("Ideal for titles and names that need to support markup such as bold, italics or links"),
* @Translation("Efficient storage for short text"),
* @Translation("Requires specifying a maximum length"),
* @Translation("Good for fields with known or predictable lengths"),
* },
* category = "formatted_text",
* default_widget = "text_textfield",
* default_formatter = "text_default",
* list_class = "\Drupal\text\Plugin\Field\FieldType\TextFieldItemList"
* )
*/This is true for alle field types in core where an advanced descrippion of what can be done with a particular field type is given.
See it for your self here: https://youtu.be/Tt_5GLa1hSw
Steps to reproduce
1. install Drupal
2. Add German as second langage
3. Goto /admin/structure/types/manage/article/fields/add-field
4. Click the fied type you like to add e.g. plaintext (Klartext)
Result:

Proposed resolution
Make sure theese strings got extracted as well.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | 06-08-2024_21-27-22.png | 101.8 KB | joachim namyslo |
| purpose textes add field.png | 99.05 KB | joachim namyslo |
Issue fork potx-3412541
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
drummThis is looking for
@Translationto be preceded by=https://git.drupalcode.org/project/potx/-/blob/46e7fc79155563144f4f2f361...Assuming this is valid syntax for Drupal core, either the
=should be removed or additional possibilities for preceding characters.Comment #3
gábor hojtsyWe can probably remove the requirement for the =, I don't think we expected list items be translated like that when we wrote that code. Patch would be relatively easy I think. A fail text could prove such an annotation as in the issue summary does not get parsed currently while a pass patch would show it does when the = requirement in the matching is removed.
Should be coded against both 7.3 and 8.1.
Comment #7
bramdriesenLet's see what the tests do :)
Comment #8
bramdriesenAll green 🙂 manually tested the regex and to me it seems this is doing what we are expecting it to do.
Comment #9
joachim namysloThank you all for fixing that issue, again. I'm looking forward to the commit of this so we can update the user guide for Drupal 10.2.0
Comment #10
gábor hojtsyI agree the fix looks good. Would be great to add test coverage for the list item case (test items to the sample PHP file we have and verify in the test that they are found). Thanks!
Comment #11
joachim namysloIs something preventing preventing us from applying this, still?
Comment #13
tessa bakkerAdded some tests for D8+ skipped D7.
Comment #14
joachim namysloAre we able to test and fix this meanwhile? Currently it is the last untranslated pice in Core.
Comment #17
tessa bakkerAdded the same D8 tests for the D7 branch.
Comment #18
gábor hojtsyLooks good on a patch review, added test coverage looks great.
Comment #20
gábor hojtsyComment #22
gábor hojtsyThanks all! I am not sure how @drumm updates the live site's potx, but once that is done, this will be online.
Comment #24
joachim namysloI am not sure if this is really fixed. Shouldn't a fix lead us to some new translatable ui strings in core at least? They are still missing, so we should re-open this issue.
Comment #25
drummThis hadn’t been deployed to localize.drupal.org yet, but is now.
We’ll need to know which releases need a re-parse to fully have this done.
Comment #26
drummThis looks like 10.2.* were affected, those have been set to reparse on localize.drupal.org
Comment #27
joachim namyslo