Drupal 8 – Change Save to Submit on form via preprocess


I need to change the text of the “Save” button of a node creation form of a certain content type (form is displayed in front-office). I tried this preprocess function :

function mytheme_my_content_type_form_alter(&$variables, &$form){
  if ( isset($form['actions']['publish']) ) {
    $form['actions']['publish']['#value'] = 'Submit';

I’m kinda stuck here…

Thanks for your help !

Drupal version: 

Source: https://www.drupal.org/taxonomy/term/3/feed