Figure out automated ways to present the translation screens as tabs on the original configuration edit screens. Detect if the config is a config entity and see where the editing URL might be. Otherwise need to map config keys to paths somehow. Likely need to introduce a contrib API for this.

CommentFileSizeAuthor
#1 Screenshot_3_8_13_10_22_AM-3.png71.81 KBgábor hojtsy

Comments

gábor hojtsy’s picture

Status: Active » Needs work
StatusFileSize
new71.81 KB

http://drupalcode.org/project/config_translation.git/commit/7abb37d700e0...

Committed a first version of this which covers the site info and the site maintenance page. It tracks where you came from, so if you came from the site info admin page, it will land you back on that overview, otherwise it will land you back into the config translation overview. (May not be correct yet, since it does not actually make you return to the same page levels, will need to adapt).

Config entities, such as views not yet supported.

Also, the user page also proved to be an interesting page, because the one screen has translatables under two config keys. So we'll need to change the form logic to be able to present two configs on the same screen. It may be that we need to attack this problem from defining concepts to translate first, since the concept can be composed of multiple config files, or can be a config entity or a standalone config file. Food for thought. For now celebrate this:

Screenshot_3_8_13_10_22_AM-3.png

gábor hojtsy’s picture

Just pushed another big update for this, needed to turn the API upside down since now we need to support multiple config keys per form. This *will* need some more cleanups and code organization improvements, however now it is possible to define better titles for config translatable and also possible to edit multiple keys under the same form. Key parts:

  $path_info['admin/config/people/accounts'] = array(
    'title' => t('Account settings'),
    'names' => array('user.settings', 'user.mail'),
  );

on delete:

  foreach ($form_values['names'] as $name) {
    $storage->delete('locale.config.' . $form_values['langcode'] . '.' . $name);
  }
?»

on edit:

<?php
  $names = $form_values['names'];
  foreach ($names as $id => $name) {
    foreach ($form_values[$id] as $key => $value) {
      config('locale.config.' . $langcode . '.' . $name)
        ->set($key, $value);
    }
    config('locale.config.' . $langcode . '.' . $name)->save();
  }

etc.

http://drupalcode.org/project/config_translation.git/commitdiff/f0ee1dc5...

gábor hojtsy’s picture

Moved this further by abstracting the config groups a bit to their own class: http://drupalcode.org/project/config_translation.git/commitdiff/335a8102... - this way we can ask them whether they have schema, translatables, etc. Also added an alter hook possibility.

The bug from before where the second config file is not saved is still present :/

gábor hojtsy’s picture

Also expanded on this to support config entities. Views translation, building the translation operation right into the options for views. http://drupalcode.org/project/config_translation.git/commitdiff/14c4daef... Still needs refinement.

gábor hojtsy’s picture

Status: Needs work » Fixed

I think this is essentially done functionality-wise. There are certainly ways we should be able to expand this and Drupal 8-ify the architecture, but the basics are working (and tested thanks to #1954086: Add testing for a config entity).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.