3 namespace Drupal\locale\Controller;
5 use Drupal\Core\Controller\ControllerBase;
8 * Return response for manual check translations.
10 class LocaleController extends ControllerBase {
13 * Checks for translation updates and displays the translations status.
15 * Manually checks the translation status without the use of cron.
17 * @return \Symfony\Component\HttpFoundation\RedirectResponse
18 * A redirection to translations reports page.
20 public function checkTranslation() {
21 $this->moduleHandler()->loadInclude('locale', 'inc', 'locale.compare');
23 // Check translation status of all translatable project in all languages.
24 // First we clear the cached list of projects. Although not strictly
25 // necessary, this is helpful in case the project list is out of sync.
26 locale_translation_flush_projects();
27 locale_translation_check_projects();
29 // Execute a batch if required. A batch is only used when remote files
32 return batch_process('admin/reports/translations');
35 return $this->redirect('locale.translate_status');
39 * Shows the string search screen.
42 * The render array for the string search screen.
44 public function translatePage() {
46 'filter' => $this->formBuilder()->getForm('Drupal\locale\Form\TranslateFilterForm'),
47 'form' => $this->formBuilder()->getForm('Drupal\locale\Form\TranslateEditForm'),