The property 'string' is protected as I can see here https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StringTranslation!TranslatableMarkup.php/class/TranslatableMarkup/8.2.x
but I need to change word "- Any -" in my exposed filter form to my string "All terms"?
I cannot do this cause I do not know how to use this class and how to change output.
This hook says: cannot get value of protected property.
function MYtheme_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if ( ( $form['#attributes']['class'][0] == 'views-exposed-form' ) &&
( $form['#info']['filter-field_color_target_id']['operator'] == 'field_color_target_id_op' ) )
{
dpm($form['color']['#options']['All']->string);
//$form['color']['#options']['All']->string = t('All terms');
}
}