I've followed a few tutorials on how to set up a custom settings form and create translations. All this seems to work, but after adding a translation, I am unable to get the config settings for that language in my controller.
In the image below, you can see that I have "warranty.settings" in spanish in the config table.
I just can't figure out the code to access that.
$language_manager = \Drupal::languageManager(); $language = $language_manager->getLanguage('es'); // $language = $language_manager->getLanguage('language.es'); // Doesn't work either. $language_manager->setConfigOverrideLanguage($language); $config = \Drupal::config('warranty.config')->get('title'); // Does not return "fgdgf" as shown in database.
I don't know if I've messed something up with how this is getting stored or if I'm somehow calling this incorrectly.
Can anyone help lead me in the right direction?