How to add a custom variable that can be accessed on bootstrap's menu--account.html.twig? I have a custom theme (subtheme of drupal bootstrap theme).  We are overriding menu--account.html.twig.  So I copied menu--account.html.twig from the bootstrap theme template folder into my theme's template folder, and I verified this template is being used because static text changes I added show up on screen.  

Now I'm trying to add a variable that the menu--account.html.twig template can read.

How do I do that?  My variable's name is 'nickname'.  I tried this:

 function mymodule_preprocess_menu__account(&amp;$variables)
 {     
     $variables['nickname'] = 'Jeff';     
 }  


The variable is added to the array, and I can see it if I use dpm, but when I reference {{nickname}} in the template it's always null.

I also read I had to define the variable like this:

 function candidate_poral_theme_registry_alter(&amp;$theme_registry)
 {
   $theme_registry['menu__account']['variables']['nickname'] = 'default';
 }


But that also doesn't work.  

Any assistance would be welcome.
I have done this for a theme on past projects. Be sure to pass it in through the content item:

Example

use Drupal\Core\Render\Markup;

function mytheme_theme_registry_alter(&amp;$theme_registry) { 
  $theme_registry['menu__account']['variables']['nickname'] = 'default'; 
}

function mytheme_preprocess_menu__account(&amp;$variables) {
  // code...

  $variables['content']['#nickname'] = [
    .. renderable properties
  ];

  // or also...

  $variables['content']['#nickname'] = Markup::create('Jeff');
}


Then, in the twig template:

{{ custom_var }}