Menu links related to "Devel generate", under development menu, are not translatable.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Tomazetti created an issue. See original summary.

Tomazetti’s picture

willzyx’s picture

Status: Needs review » Needs work

@Tomazetti thanks for contributing!
A quick review:

+++ b/devel_generate/devel_generate.module
@@ -15,7 +15,7 @@ function devel_generate_menu_links_discovered_alter(&$links) {
-      'title' => "Generate $label",
+      'title' => t("Generate $label"),
       'parent' => 'system.admin_config_development',

1) The label must be passed in as argument and inserted via a placeholder.
2) When possible you need to create a new \Drupal\Core\StringTranslation\TranslatableMarkup object instead of use t() function

moving to NW ;)

Tomazetti’s picture

FileSize
997 bytes

Changed the patch to insert label via placeholder.

Why should I create a new \Drupal\Core\StringTranslation\TranslatableMarkup object instead of use t() function?

Tomazetti’s picture

Status: Needs work » Needs review
Tomazetti’s picture

Title: Untranslatables menus » Untranslatable menus

willzyx’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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