Commit 8b45d212 authored by alexpott's avatar alexpott

Issue #1978926 by likin, YesCT, Pancho, kim.pepper, h3rj4n, tim.plunkett,...

Issue #1978926 by likin, YesCT, Pancho, kim.pepper, h3rj4n, tim.plunkett, disasm, Luxian, neetu morwani | vijaycs85: Convert locale_translation_status_form to a Controller.
parent 37e61b15
......@@ -1369,3 +1369,19 @@ function _locale_rebuild_js($langcode = NULL) {
return TRUE;
}
}
/**
* Form element callback: After build changes to the language update table.
*
* Adds labels to the languages and removes checkboxes from languages from which
* translation files could not be found.
*/
function locale_translation_language_table($form_element) {
// Remove checkboxes of languages without updates.
if ($form_element['#not_found']) {
foreach ($form_element['#not_found'] as $langcode) {
$form_element[$langcode] = array();
}
}
return $form_element;
}
This diff is collapsed.
......@@ -40,7 +40,7 @@ locale.translate_export:
locale.translate_status:
path: '/admin/reports/translations'
defaults:
_content: '\Drupal\locale\Form\LocaleForm::status'
_form: '\Drupal\locale\Form\TranslationStatusForm'
_title: 'Available translation updates'
requirements:
_permission: 'translate interface'
<?php
/**
* @file
* Contains \Drupal\locale\Form\LocaleForm.
*/
namespace Drupal\locale\Form;
/**
* Temporary form controller for locale module.
*/
class LocaleForm {
/**
* Wraps locale_translation_status_form().
*
* @todo Remove locale_translation_status_form().
*/
public function status() {
module_load_include('pages.inc', 'locale');
return \Drupal::formBuilder()->getForm('locale_translation_status_form');
}
}
This diff is collapsed.
......@@ -70,6 +70,10 @@ function testUpdateProjects() {
* for local files only, check for both local and remote files.
*/
function testUpdateCheckStatus() {
// Case when contributed modules are absent.
$this->drupalGet('admin/reports/translations');
$this->assertText(t('Missing translations for one project'));
$config = \Drupal::config('locale.settings');
// Set a flag to let the locale_test module replace the project data with a
// set of test projects.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment