Tom_VDB β made their first commit to this issueβs fork.
Multilingual works only if both the node and the paragraph are translatable.
Can you confirm it is set up like this?
Let me know if you have any issues.
Tom_VDB β made their first commit to this issueβs fork.
Tom_VDB β changed the visibility of the branch 2.1.x to hidden.
I have picked up maintaining this module.
Tom_VDB β created an issue.
Tom_VDB β created an issue.
I needed the language the user used to create the order.
I resorted to enabling the langcode
field on commerce_order
.
In a custom module:
function example_entity_type_build(array &$entity_types) {
$keys = $entity_types['commerce_order']->getKeys();
$keys['langcode'] = 'langcode';
$entity_types['commerce_order']->set('entity_keys', $keys);
}
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Add 'langcode' to 'commerce_order'.
*/
function example_update_8001() {
$storage_definition = BaseFieldDefinition::create('language')
->setLabel(new TranslatableMarkup('Language'))
->setDisplayOptions('view', [
'region' => 'hidden',
])
->setDisplayOptions('form', [
'type' => 'language_select',
'weight' => 2,
]);
\Drupal::entityDefinitionUpdateManager()->installFieldStorageDefinition('langcode', 'commerce_order', 'commerce_order', $storage_definition);
}
This hold the current langcode when the order is first created.
After which it is accessible with $order->langcode()
Tom_VDB β created an issue.