Background information #2052193: [META] Date format localisation is a huge mess, conflicts, does not work, regressed

This is the first try to move date format translation into locale and get it consistent with the rest of the localization system. Attached screenshot of the new UI which kind of explains everything by itself, I think.

drupal8_rework_date_translation_ui.png

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero’s picture

Status: Active » Needs review
FileSize
29 KB

And here's the patch (that produces the UI above). In short:
- Move all date format localization to locale module.
- Create new UI that allows to translate existing date formats.
- Cleans up the configuration translations for date formats created by the old system, which had a lot of duplicated date.

To do:
- Well, discuss the new UI....
- Update tests.
- Remove language (locale) options from date format configurations

Status: Needs review » Needs work

The last submitted patch, 2059835-date_formats_localization-01.patch, failed testing.

Gábor Hojtsy’s picture

Issue tags: +language-config

How does this compare to the Drupal 7 features? There does not seem to be an upgrade path in this code(?)

jair’s picture

Issue tags: +Needs reroll
penyaskito’s picture

Title: Add consistent UI for localized date formats into locale module. » [META] Date format localisation is a huge mess, conflicts, does not work, regressed
Component: locale.module » base system
Priority: Normal » Major
Status: Needs work » Active
Issue tags: -Needs reroll +Needs usability review, +Regression, +Configuration system, +sprint

+ Needs usability review, but IMHO it looks far better than D7 UI. Congrats!

I started reviewing the patch and I have some comments.

1.

@@ -239,7 +248,7 @@ function locale_translate_filter_form_submit($form, &$form_state) {
 
   }
 
-  $form_state['redirect'] = 'admin/config/regional/translate/translate';
+  //$form_state['redirect'] = 'admin/config/regional/translate/translate';
 }

Needs to be removed or not commented.

2.

+ * @file
+ * Contains \Drupal\system\Form\DateFormatLocalizeResetForm.
+ */
+
+namespace Drupal\system\Form;

Namespace should be Drupal\locale\Form now.

3.

+function theme_locale_translate_edit_form_dates($variables) {
[...]
+  $output .= theme('table', array(
+    'header' => $header,
+    'rows' => $rows,
+    'empty' => t('No date formats available.'),
+    'attributes' => array('class' => array('locale-translate-edit-table')),
+  ));
+

I think we shouldn't be calling theme() but returning the render array, but this is a theme_* function so I am not really sure about it. Maybe affected by #2006152: [meta] Don't call theme() directly anywhere outside drupal_render()?

Gábor Hojtsy’s picture

I think this should still have a more holistic look and hopefully natively integrated with config translation.

Gábor Hojtsy’s picture

Title: [META] Date format localisation is a huge mess, conflicts, does not work, regressed » Implement translation interface for date formats as part of locale UI
Status: Active » Closed (duplicate)
Issue tags: -sprint

AFAIS let's focus on solving this with a standard solution as part of config translation, that already manages the files, we can integrate this with locale module (localize.drupal.org distribution of translations). So I think this is covered by #2098089: Date formats cannot be translated (the core UIs are useless) and #2099997: Use config translation to translate date formats and will have a standard solution in core the same way every other config has.