getLanguages()) < 2) { $t_args = array('!language_url' => \Drupal::url('entity.configurable_language.collection')); $message = t('Be sure to add at least two languages to translate content.', $t_args); drupal_set_message($message, 'warning'); } // Point the user to the content translation settings. $t_args = array('!settings_url' => \Drupal::url('language.content_settings_page')); $message = t('Enable translation for content types, taxonomy vocabularies, accounts, or any other element you wish to translate.', $t_args); drupal_set_message($message, 'warning'); }