How to change property 'string' in object with class Drupal\Core\StringTranslation\TranslatableMarkup in my hook? 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(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  if ( ( $form['#attributes']['class'][0] == 'views-exposed-form' ) &amp;&amp;  
       ( $form['#info']['filter-field_color_target_id']['operator'] == 'field_color_target_id_op' ) )
  {
      dpm($form['color']['#options']['All']-&gt;string);
      //$form['color']['#options']['All']-&gt;string = t('All terms');
  }
}
The object TranslatableMarkup is the result of t(). It's not possible to modify the content of this object. You overwrite the object with a new instance:

form['color']['#options']['All'] = t('All terms');