- 🇮🇳India rassoni Bangalore
grep -rl "use[ ]*StringTranslationTrait" * |grep -v "^modules" |xargs grep -n "\<t\>(" | grep -v "\* *" | grep -v "this->t"
Found new files in D10. Fixed and create a patch. Please review.
- Status changed to Needs review
almost 2 years ago 2:15pm 16 March 2023 - Status changed to RTBC
almost 2 years ago 4:44pm 16 March 2023 - last update
over 1 year ago Patch Failed to Apply - Status changed to Needs work
over 1 year ago 4:01am 17 April 2023 - 🇳🇿New Zealand quietone
I checked the original issue and am adding credit for krishnan.n as suggested in the Issue Summary.
A reminder that when reviewing a patch or setting it to RTBC it is very helpful to describe in detail what one did to review the patch. There is Review a patch or merge request → which should provide some guidance.
I applied that patch and ran the grep command, which I added to the IS, and there were more usages. The reason these are not being changed should be stated in the Issue Summary and/or the review comment.
The issue title status 'round 2'. Is there a round 3? Is there more to do? If these are indeed the last ones to fix, then a title change is in order.
Oh wait, there are many other issues about replacing t(). Yes, here is the Meta, 📌 [META] Replace t() calls inside of classes Active . I am adding this to that Meta.
So, now we need to make sure that the scope is correct here and not conflicting with that issue or other children of that issue.
Setting to NW for scoping, title change, issue summary update.
- Merge request !8574Replace t() with $this->t() where possible. ( Round 2 ) → (Closed) created by quietone
- Status changed to Needs review
6 months ago 10:42am 28 June 2024 - 🇳🇿New Zealand quietone
Running the grep command now results in the following. The remaining occurrences are in comments and non-object context.
)$ grep -rl "use[ ]*StringTranslationTrait" * |grep -v "^modules" |xargs grep -n "\<t\>(" | grep -v "\* *" | grep -v "this->t" core/lib/Drupal/Core/Entity/EntityFieldManager.php:668: // hook_entity_extra_field_info_alter() might contain t() calls, we cache core/lib/Drupal/Core/Config/ConfigManager.php:178: // Cast the result of t() to a string, as the diff engine doesn't know core/lib/Drupal/Core/Config/ConfigManager.php:184: // Cast the result of t() to a string, as the diff engine doesn't know core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:104: // rather than use t() since we are in the middle of error handling, and core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:105: // we don't want t() to cause further errors. core/modules/media/src/Entity/Media.php:483: ->setLabel(t('Name')) core/modules/media/src/Entity/Media.php:497: ->setLabel(t('Thumbnail')) core/modules/media/src/Entity/Media.php:498: ->setDescription(t('The thumbnail of the media item.')) core/modules/media/src/Entity/Media.php:513: ->setLabel(t('Authored by')) core/modules/media/src/Entity/Media.php:514: ->setDescription(t('The user ID of the author.')) core/modules/media/src/Entity/Media.php:545: ->setLabel(t('Authored on')) core/modules/media/src/Entity/Media.php:546: ->setDescription(t('The time the media item was created.')) core/modules/media/src/Entity/Media.php:563: ->setLabel(t('Changed')) core/modules/media/src/Entity/Media.php:564: ->setDescription(t('The time the media item was last edited.')) core/modules/media_library/src/MediaLibraryUiBuilder.php:95: 'title' => t('Add or select media'),
- Status changed to RTBC
6 months ago 3:10pm 2 July 2024 - 🇺🇸United States smustgrave
I got a different result then #42 but after removing all the translation items believe I got the same actually
grep -rl "use[ ]*StringTranslationTrait" * |grep -v "^modules" |xargs grep -n "\<t\>(" | grep -v "\* *" | grep -v "this->t"
was what I ran and I gotsmustgrave@drupal-11x-web:/var/www/html/web/core$ grep -rl "use[ ]*StringTranslationTrait" * |grep -v "^modules" |xargs grep -n "\<t\>(" | grep -v "\* *" | grep -v "this->t" lib/Drupal/Core/Config/ConfigManager.php:178: // Cast the result of t() to a string, as the diff engine doesn't know lib/Drupal/Core/Config/ConfigManager.php:184: // Cast the result of t() to a string, as the diff engine doesn't know lib/Drupal/Core/Entity/EntityFieldManager.php:668: // hook_entity_extra_field_info_alter() might contain t() calls, we cache lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:104: // rather than use t() since we are in the middle of error handling, and lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:105: // we don't want t() to cause further errors. smustgrave@drupal-11x-web:/var/www/html/web/core$ grep -rl "use[ ]*StringTranslationTrait" * |grep -v "^modules" |xargs grep -n "\<t\>(" | grep -v "\* *" | grep -v "this->t" lib/Drupal/Core/Config/ConfigImporter.php:630: $context['message'] = t('Synchronizing extensions: @op @name.', ['@op' => $operation['op'], '@name' => $operation['name']]); lib/Drupal/Core/Config/ConfigImporter.php:732: $context['message'] = t('Finalizing configuration synchronization.'); lib/Drupal/Core/Config/ConfigManager.php:178: // Cast the result of t() to a string, as the diff engine doesn't know lib/Drupal/Core/Config/ConfigManager.php:184: // Cast the result of t() to a string, as the diff engine doesn't know lib/Drupal/Core/Entity/EntityDisplayRepository.php:190: $options = ['default' => t('Default')]; lib/Drupal/Core/Entity/EntityFieldManager.php:668: // hook_entity_extra_field_info_alter() might contain t() calls, we cache lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:104: // rather than use t() since we are in the middle of error handling, and lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:105: // we don't want t() to cause further errors. smustgrave@drupal-11x-web:/var/www/html/web/core$ cd .. smustgrave@drupal-11x-web:/var/www/html/web$ grep -rl "use[ ]*StringTranslationTrait" * |grep -v "^modules" |xargs grep -n "\<t\>(" | grep -v "\* *" | grep -v "this->t" core/lib/Drupal/Core/Config/ConfigImporter.php:630: $context['message'] = t('Synchronizing extensions: @op @name.', ['@op' => $operation['op'], '@name' => $operation['name']]); core/lib/Drupal/Core/Config/ConfigImporter.php:732: $context['message'] = t('Finalizing configuration synchronization.'); core/lib/Drupal/Core/Config/ConfigManager.php:178: // Cast the result of t() to a string, as the diff engine doesn't know core/lib/Drupal/Core/Config/ConfigManager.php:184: // Cast the result of t() to a string, as the diff engine doesn't know core/lib/Drupal/Core/Entity/EntityDisplayRepository.php:190: $options = ['default' => t('Default')]; core/lib/Drupal/Core/Entity/EntityFieldManager.php:668: // hook_entity_extra_field_info_alter() might contain t() calls, we cache core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:104: // rather than use t() since we are in the middle of error handling, and core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php:105: // we don't want t() to cause further errors. core/modules/content_moderation/src/ViewsData.php:62: 'title' => t('Moderation state'), core/modules/content_moderation/src/ViewsData.php:74: 'title' => t('Moderation state'), core/modules/content_moderation/src/EntityTypeInfo.php:266: ->setLabel(t('Moderation state')) core/modules/content_moderation/src/EntityTypeInfo.php:267: ->setDescription(t('The moderation state of this piece of content.')) core/modules/file/src/Controller/FileWidgetAjaxController.php:33: $progress['message'] = t('Uploading... (@current of @total)', [ core/modules/language/tests/language_test/src/Controller/LanguageTestController.php:80: '#title' => t('Link to the current path with no langcode provided.'), core/modules/language/tests/language_test/src/Controller/LanguageTestController.php:91: '#title' => t('Link to a French version of the current path.'), core/modules/language/tests/language_test/src/Controller/LanguageTestController.php:103: '#title' => t('Link to an English version of the current path.'), core/modules/user/src/ModulePermissionsLinkHelper.php:52: 'title' => t('Configure @module permissions', ['@module' => $name]), core/modules/workspaces/src/WorkspacesLazyBuilders.php:41: 'title' => t('Switch workspace'), core/modules/media_library/src/MediaLibraryUiBuilder.php:95: 'title' => t('Add or select media'), core/modules/node/src/NodePermissions.php:60: 'description' => t('To view a revision, you also need permission to view the content item.'), core/modules/node/src/NodePermissions.php:64: 'description' => t('To revert a revision, you also need permission to edit the content item.'), core/modules/content_translation/src/ContentTranslationHandler.php:122: ->setLabel(t('Translation source')) core/modules/content_translation/src/ContentTranslationHandler.php:123: ->setDescription(t('The source language from which this translation was created.')) core/modules/content_translation/src/ContentTranslationHandler.php:130: ->setLabel(t('Translation outdated')) core/modules/content_translation/src/ContentTranslationHandler.php:131: ->setDescription(t('A boolean indicating whether this translation needs to be updated.')) core/modules/content_translation/src/ContentTranslationHandler.php:139: ->setLabel(t('Translation author')) core/modules/content_translation/src/ContentTranslationHandler.php:140: ->setDescription(t('The author of this translation.')) core/modules/content_translation/src/ContentTranslationHandler.php:150: ->setLabel(t('Translation status')) core/modules/content_translation/src/ContentTranslationHandler.php:151: ->setDescription(t('A boolean indicating whether the translation is visible to non-translators.')) core/modules/content_translation/src/ContentTranslationHandler.php:160: ->setLabel(t('Translation created time')) core/modules/content_translation/src/ContentTranslationHandler.php:161: ->setDescription(t('The Unix timestamp when the translation was created.')) core/modules/content_translation/src/ContentTranslationHandler.php:168: ->setLabel(t('Translation changed time')) core/modules/content_translation/src/ContentTranslationHandler.php:169: ->setDescription(t('The Unix timestamp when the translation was most recently saved.')) core/modules/content_translation/src/ContentTranslationHandler.php:306: $title = $new_translation ? t('Create %language translation of %title', $t_args) : t('@title [%language translation]', $t_args); core/modules/content_translation/src/ContentTranslationHandler.php:317: '#title' => t('Source language: @language', ['@language' => $languages[$source_langcode]->getName()]), core/modules/content_translation/src/ContentTranslationHandler.php:322: '#title' => t('Select source language'), core/modules/content_translation/src/ContentTranslationHandler.php:330: '#value' => t('Change'), core/modules/content_translation/src/ContentTranslationHandler.php:406: '#title' => t('Translation'), core/modules/content_translation/src/ContentTranslationHandler.php:437: t('An unpublished translation will not be visible without translation permissions.') : core/modules/content_translation/src/ContentTranslationHandler.php:438: t('Only this translation is published. You must publish at least one more translation to unpublish this one.'); core/modules/content_translation/src/ContentTranslationHandler.php:442: '#title' => t('This translation is published'), core/modules/content_translation/src/ContentTranslationHandler.php:458: '#title' => t('Flag other translations as outdated'), core/modules/content_translation/src/ContentTranslationHandler.php:460: '#description' => t('If you made a significant change, which means the other translations should be updated, you can flag all translations of this content as outdated. This will not change any other property of them, like whether they are published or not.'), core/modules/content_translation/src/ContentTranslationHandler.php:467: '#title' => t('This translation needs to be updated'), core/modules/content_translation/src/ContentTranslationHandler.php:469: '#description' => t('When this option is checked, this translation needs to be updated. Uncheck when the translation is up to date again.'), core/modules/content_translation/src/ContentTranslationHandler.php:485: '#title' => t('Authored by'), core/modules/content_translation/src/ContentTranslationHandler.php:491: '#description' => t('Leave blank for %anonymous.', ['%anonymous' => \Drupal::config('user.settings')->get('anonymous')]), core/modules/content_translation/src/ContentTranslationHandler.php:497: '#title' => t('Authored on'), core/modules/content_translation/src/ContentTranslationHandler.php:499: '#description' => t('Leave blank to use the time of form submission.'), core/modules/content_translation/src/ContentTranslationHandler.php:618: $suffix = ' <span class="translation-entity-all-languages">(' . t('all languages') . ')</span>'; core/modules/content_translation/src/ContentTranslationHandler.php:682: $form_state->setErrorByName('content_translation][uid', t('The translation authoring username %name does not exist.', ['%name' => $account->getAccountName()])); core/modules/content_translation/src/ContentTranslationHandler.php:686: $form_state->setErrorByName('content_translation][created', t('You have to specify a valid translation authoring date.')); core/modules/content_translation/src/ContentTranslationHandler.php:732: $this->messenger->addStatus(t('Source language set to: %language', ['%language' => $languages[$source]->getName()])); core/modules/content_translation/src/ContentTranslationHandler.php:744: $this->messenger->addWarning(t('This will delete all the translations of %label.', ['%label' => $entity->label() ?? $entity->id()])); core/modules/media/src/Entity/Media.php:483: ->setLabel(t('Name')) core/modules/media/src/Entity/Media.php:497: ->setLabel(t('Thumbnail')) core/modules/media/src/Entity/Media.php:498: ->setDescription(t('The thumbnail of the media item.')) core/modules/media/src/Entity/Media.php:513: ->setLabel(t('Authored by')) core/modules/media/src/Entity/Media.php:514: ->setDescription(t('The user ID of the author.')) core/modules/media/src/Entity/Media.php:545: ->setLabel(t('Authored on')) core/modules/media/src/Entity/Media.php:546: ->setDescription(t('The time the media item was created.')) core/modules/media/src/Entity/Media.php:563: ->setLabel(t('Changed')) core/modules/media/src/Entity/Media.php:564: ->setDescription(t('The time the media item was last edited.'))
Either way definitely a net improvement.
- Status changed to Fixed
5 months ago 12:55pm 17 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.