Loading l10n_community/src/Controller/L10nCommunityLanguagesController.php +9 −5 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\Core\Database\Connection; use Drupal\Core\Language\Language; use Drupal\Core\Url; use Drupal\group\Entity\Group; use Drupal\l10n_server\Entity\L10nServerProject; use Drupal\l10n_server\Entity\L10nServerProjectInterface; use Drupal\l10n_server\Entity\L10nServerReleaseInterface; use Symfony\Component\DependencyInjection\ContainerInterface; Loading Loading @@ -208,6 +209,7 @@ class L10nCommunityLanguagesController extends ControllerBase { * @throws \Drupal\Core\TypedData\Exception\MissingDataException */ public function translate(Group $group): array { /** @var \Drupal\l10n_community\L10nTranslator $translator */ $translator = \Drupal::service('l10n_community.translator'); $langcode = $group->get('field_translation_language')->first()->getValue()['target_id']; $language = \Drupal::languageManager()->getLanguage($langcode); Loading @@ -225,8 +227,9 @@ class L10nCommunityLanguagesController extends ControllerBase { // Set the most appropriate title. if ($filters['project']) { $project = L10nServerProject::load($filters['project']); $build['#title'] = $this->t('Translate %project to @language', [ '%project' => $filters['project']->label(), '%project' => $project->label(), '@language' => $this->t($language->getName()), ]); } Loading @@ -241,11 +244,12 @@ class L10nCommunityLanguagesController extends ControllerBase { // Output the actual strings. if (!count($strings)) { drupal_set_message(t('No strings found with this filter. Try adjusting the filter options.')); \Drupal::messenger()->addError($this->t('No strings found with this filter. Try adjusting the filter options.')); } // else { else { //$build['filter'] = \Drupal::formBuilder()->getForm('Drupal\l10n_community\Form\TranslateForm'); //$output[] = drupal_get_form('l10n_community_translate_form', $language, $filters, $strings); // } } $build['content'] = [ '#type' => 'item', Loading Loading
l10n_community/src/Controller/L10nCommunityLanguagesController.php +9 −5 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\Core\Database\Connection; use Drupal\Core\Language\Language; use Drupal\Core\Url; use Drupal\group\Entity\Group; use Drupal\l10n_server\Entity\L10nServerProject; use Drupal\l10n_server\Entity\L10nServerProjectInterface; use Drupal\l10n_server\Entity\L10nServerReleaseInterface; use Symfony\Component\DependencyInjection\ContainerInterface; Loading Loading @@ -208,6 +209,7 @@ class L10nCommunityLanguagesController extends ControllerBase { * @throws \Drupal\Core\TypedData\Exception\MissingDataException */ public function translate(Group $group): array { /** @var \Drupal\l10n_community\L10nTranslator $translator */ $translator = \Drupal::service('l10n_community.translator'); $langcode = $group->get('field_translation_language')->first()->getValue()['target_id']; $language = \Drupal::languageManager()->getLanguage($langcode); Loading @@ -225,8 +227,9 @@ class L10nCommunityLanguagesController extends ControllerBase { // Set the most appropriate title. if ($filters['project']) { $project = L10nServerProject::load($filters['project']); $build['#title'] = $this->t('Translate %project to @language', [ '%project' => $filters['project']->label(), '%project' => $project->label(), '@language' => $this->t($language->getName()), ]); } Loading @@ -241,11 +244,12 @@ class L10nCommunityLanguagesController extends ControllerBase { // Output the actual strings. if (!count($strings)) { drupal_set_message(t('No strings found with this filter. Try adjusting the filter options.')); \Drupal::messenger()->addError($this->t('No strings found with this filter. Try adjusting the filter options.')); } // else { else { //$build['filter'] = \Drupal::formBuilder()->getForm('Drupal\l10n_community\Form\TranslateForm'); //$output[] = drupal_get_form('l10n_community_translate_form', $language, $filters, $strings); // } } $build['content'] = [ '#type' => 'item', Loading