Skip to content
Snippets Groups Projects

#3244002 Add multilingual fields to term edit form

Closed #3244002 Add multilingual fields to term edit form
4 unresolved threads
Closed Martin Malovanets requested to merge issue/taxonomy_manager-3244002:2.0.x into 2.0.x
4 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I've tested it and have some comments:

    • I can't add translation, it always save the English one for example (i change the langauge in ui from en to de, select the term and resave it, also tried changing the language)

    • I think it would be nice if we can load the term tree by current language or possibility to switch the language (the list isn't loaded by language)

    • after saving the translation we always get redirected to the default language

    • when you switch the language and there is no translation it loads the default language instead of adding a new translation

    • I think we need to find an intuitive way to add a translation for the selected taxonomy term (maybe popup and embedding the form in it?) - for example like we have to term merge

    Edited by Ales Bencina
37 37 }
38 38 }
39
40 /**
41 * Implements hook_form_FORM_ID_alter().
42 */
43 function taxonomy_manager_form_taxonomy_term_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
44 if (\Drupal::config('taxonomy_manager.settings')->get('taxonomy_manager_translations')) {
45 $form['actions']['submit']['#submit'][] = 'taxonomy_manager_field_translations_submit';
46 }
47 }
48
49 /**
50 * Submit callback for term field translations.
51 *
52 * @param $form
  • 38 38 }
    39
    40 /**
    41 * Implements hook_form_FORM_ID_alter().
    42 */
    43 function taxonomy_manager_form_taxonomy_term_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
    44 if (\Drupal::config('taxonomy_manager.settings')->get('taxonomy_manager_translations')) {
    45 $form['actions']['submit']['#submit'][] = 'taxonomy_manager_field_translations_submit';
    46 }
    47 }
    48
    49 /**
    50 * Submit callback for term field translations.
    51 *
    52 * @param $form
    53 * @param \Drupal\Core\Form\FormStateInterface $form_state
  • 40 /**
    41 * Implements hook_form_FORM_ID_alter().
    42 */
    43 function taxonomy_manager_form_taxonomy_term_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
    44 if (\Drupal::config('taxonomy_manager.settings')->get('taxonomy_manager_translations')) {
    45 $form['actions']['submit']['#submit'][] = 'taxonomy_manager_field_translations_submit';
    46 }
    47 }
    48
    49 /**
    50 * Submit callback for term field translations.
    51 *
    52 * @param $form
    53 * @param \Drupal\Core\Form\FormStateInterface $form_state
    54 *
    55 * @return void
  • 42 */
    43 function taxonomy_manager_form_taxonomy_term_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
    44 if (\Drupal::config('taxonomy_manager.settings')->get('taxonomy_manager_translations')) {
    45 $form['actions']['submit']['#submit'][] = 'taxonomy_manager_field_translations_submit';
    46 }
    47 }
    48
    49 /**
    50 * Submit callback for term field translations.
    51 *
    52 * @param $form
    53 * @param \Drupal\Core\Form\FormStateInterface $form_state
    54 *
    55 * @return void
    56 */
    57 function taxonomy_manager_field_translations_submit($form, \Drupal\Core\Form\FormStateInterface $form_state) {
  • Please register or sign in to reply
    Loading