Problem/Motivation

I am trying to get (and perhaps even set) the translation of a configuration entity. I do not know how, the ConfigFactory doesn't have anything where I could set a language, no method, no argument, nothing. The ConfigFactoryInterface is not implemented by any other class. All the information provided by https://www.drupal.org/node/1928898 points to nonexisting things: setLanguage method on ConfigFactory, language.config. prefix objects (I am pretty sure that's just language. prefix because of what I see in LanguageConfigCollectionNameTrait ). #2219499: Generalize language config override responsibility removed setLanguage from ConfigFactory almost two years ago and left no change record behind. It has this to say in API changes "Active language for configuration is now set on the LanguageManager".

Proposed resolution

Is LanguageManagerInterface::setConfigOverrideLanguage the one to call, then?

  1. Fix https://www.drupal.org/node/1928898
  2. Add at least a @link to that handbook page but also if possible a code sample in ConfigFactory::get would be nice

Remaining tasks

User interface changes

API changes

Data model changes

Comments

chx created an issue. See original summary.

chx’s picture

Issue summary: View changes
dawehner’s picture

Config translation is using primarily the interface \Drupal\Core\Config\ConfigFactoryOverrideInterface, which has a setLanguage
method, which is called from \Drupal\language\ConfigurableLanguageManager::setConfigOverrideLanguage

Gábor Hojtsy’s picture

https://api.drupal.org/api/drupal/core%21modules%21user%21user.module/fu... is the current code, the docs page is indeed outdated.

Gábor Hojtsy’s picture

Issue tags: +D8MI, +sprint, +language-config

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Kristen Pol’s picture

Title: Configuration translation from code documentation either doesnt exist or obsolete » Configuration translation from code documentation either does not exist or is obsolete

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.