Skip to content

Conversation

@vasike
Copy link
Contributor

@vasike vasike commented Mar 20, 2017

No description provided.

…roduct variantion add to cart not translated.
*/
public function getTranslatedReferencedEntities($field_name) {
$refereced_entities = $this->get($field_name)->referencedEntities();
return $this->ensureTranslations($refereced_entities);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo error on $refereced_entities. I guess you miss a 'n' in $referenced_entities

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed. merci

Copy link
Contributor

@mglaman mglaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of changes here. And we don't have any i18n testing. There's some initial adjustments to be made.

/**
* Provides the base class for Commerce content entities.
*/
class CommerceContentEntityBase extends ContentEntityBase implements CommerceContentEntityInterface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a base class, it must be abstract

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this only provides a public method for trnslated references. So really only relates to Product.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the usage could be extented on other place - for example any getStore(s) needs
and thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would stores need this? It doesn't have an architecture which has a concept of "child references"

$attributes[$field_name] = [
'field_name' => $field_name,
'title' => $field->getLabel(),
'title' => $this->t($field->getLabel()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to wrap this in translatable markup, as the field is config and config is already translatable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know, but there the field label won't get translated
i will update with some getTranslationFromContext somehow

@bojanz bojanz force-pushed the 8.x-2.x branch 2 times, most recently from 77bfcc5 to c15564f Compare April 21, 2017 16:14
@bojanz bojanz force-pushed the 8.x-2.x branch 3 times, most recently from 1028fc1 to 005e904 Compare April 21, 2017 19:23
@mglaman mglaman dismissed their stale review October 11, 2017 13:50

Outdated

mglaman and others added 24 commits October 11, 2017 12:39
# Conflicts:
#	modules/product/tests/src/Kernel/ProductVariationGeneratedTitleTest.php
#	modules/product/tests/src/Kernel/ProductVariationStorageTest.php
# Conflicts:
#	modules/product/src/Entity/ProductVariation.php
#	src/Entity/CommerceContentEntityBase.php
# Conflicts:
#	modules/product/tests/src/Kernel/ProductVariationGeneratedTitleTest.php
@mglaman mglaman force-pushed the 2860840-add-to-cart-multilingual branch from db26e27 to 7df708f Compare December 1, 2017 21:50
@mglaman
Copy link
Contributor

mglaman commented Dec 11, 2017

Committed in 7af1dd8

@mglaman mglaman closed this Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants