I've come across the issue where, when saving a commerce product, the set language (language select in the form) is overriden and always set to the sites default language. I think the problem lies here:

translation.handler.inc:345

  public function initTranslations() {
    $langcode = $this->getLanguage(); // returns the sites default language

    if (!empty($langcode)) {
      $translation = array('language' => $langcode, 'status' => (int) $this->getStatus());
      $this->setTranslation($translation);
      $this->setOriginalLanguage($langcode); // sets the sites default language as original language pre-save.
    }
  }

It seems to me, that per implementation, the originalLanguage is set to the sites default, fully ignoring any information passed along with the entity to be saved. My understanding of this module is far from deep enough to troubleshoot this issue, so if anyone with a better understanding wants to step in, that would be most appreciated and I can set aside some funds from my current project to pay for work on a fix.

for reference, here is the original issue at project/commerce/:
#1414554: Translation set not being saved properly on the product entity

Comments

plach’s picture

Status: Active » Closed (works as designed)

ET knows nothing about entity-specific details: Commerce needs to override the DefaultEntityTranslationHandler::getLanguage() method to return the proper value.