feature affected

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:
https://www.drupal.org/files/issues/2024-01-05/purpose%20textes%20add%20field.png

Proposed resolution

Make sure theese strings got extracted as well.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork potx-3412541

Command icon 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

Joachim Namyslo created an issue. See original summary.

drumm’s picture

This is looking for @Translation to 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.

gábor hojtsy’s picture

Version: 8.x-1.x-dev » 7.x-3.x-dev

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

BramDriesen made their first commit to this issue’s fork.

bramdriesen’s picture

Status: Active » Needs review

Let's see what the tests do :)

bramdriesen’s picture

All green 🙂 manually tested the regex and to me it seems this is doing what we are expecting it to do.

joachim namyslo’s picture

Thank 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

gábor hojtsy’s picture

I 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!

joachim namyslo’s picture

Is something preventing preventing us from applying this, still?

Tess Bakker made their first commit to this issue’s fork.

tessa bakker’s picture

Added some tests for D8+ skipped D7.

joachim namyslo’s picture

Are we able to test and fix this meanwhile? Currently it is the last untranslated pice in Core.

Tess Bakker changed the visibility of the branch 3412541-fieldtypeadvanced-descriptive-texts to hidden.

Tess Bakker changed the visibility of the branch 3412541-fieldtypeadvanced-descriptive-texts to active.

tessa bakker’s picture

Added the same D8 tests for the D7 branch.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good on a patch review, added test coverage looks great.

gábor hojtsy’s picture

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all! I am not sure how @drumm updates the live site's potx, but once that is done, this will be online.

Status: Fixed » Closed (fixed)

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

joachim namyslo’s picture

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

drumm’s picture

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

drumm’s picture

This looks like 10.2.* were affected, those have been set to reparse on localize.drupal.org

joachim namyslo’s picture

Issue summary: View changes
StatusFileSize
new101.8 KB

Only local images are allowed.