Assuming i've got a bunch of setting sections. I add these sections to my plugin page in the following way.

$sections = array('notifcations', 'updates'); foreach ($sections as $section) { add_settings_section($section .'_section',
$section, array($this, 'disable_callback_warnings' ),
'sgnc'
);
}


Everything works as expected but i wonder how to localise the section headline? As far as i know i can't pass any variables to the locale functions _e() and __(). So this won't work:

$sections = array('notifcations', 'updates'); foreach ($sections as $section) { add_settings_section($section .'_section',
__($section), array($this, 'disable_callback_warnings' ),
'sgnc'
);
}


-

$sections = array( 'notifcations' => __( 'Notifications', 'your_text_domain' ), 'updates' => __( 'Updates', 'your_text_domain' ) ); foreach ($sections as $section =>$header )
$section .'_section',$header,