Problem/Motivation
1. Install Drupal 8 standard. Enable Language, Content translation modules.
2. Configure Articles to be translatable. The tags field on the article should not be translatable (there are confusing things if you make them translatable that do not relate to this issue).
3. However do configure tag terms to be translatable.
4. Add an article with taxonomy terms.
5. Translate those taxonomy terms as their own entities.
6. Translate the article.
Now regardless of which translation of the article you are viewing, the same original language is used to render the terms. Not good.
Proposed resolution
Make the terms show up in the rendering language of the entity.
Remaining tasks
Figure out why, fix, test.
User interface changes
Terms will show up properly localized as expected.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#20 | 2345607-fix-head.patch | 717 bytes | webflo |
#3 | 2345607-translated_terms_not_rendered-test_only-3.patch | 4.79 KB | Désiré |
#4 | 2345607-translated_terms_not_rendered-test_only-4.patch | 6.04 KB | Désiré |
#5 | 2345607-translated_terms_not_rendered-5.patch | 6.61 KB | YesCT |
#5 | interdiff.2345607.4.5.txt | 3.06 KB | YesCT |
Comments
Comment #1
Désiré CreditAttribution: Désiré commentedComment #2
Gábor HojtsyComment #3
Désiré CreditAttribution: Désiré commentedTest only patch attached.
Comment #4
Désiré CreditAttribution: Désiré commentedHere I have a supposed solution, to fix the problem in
\Drupal\taxonomy\Plugin\Field\FieldFormatter\TaxonomyFormatterBase
but it's not works yet, and Im also not sure if it should be fixed there.However I attached the patch.
Comment #5
YesCT CreditAttribution: YesCT commentedwhile looking at the test patch in #3 I noticed that ->save was not an available method... cause it is type hinted on the interface (the object has a save(). And @tstoeckler and I found #2175517: Entity displays are themselves config entities which looks like was missing a push. @alimac is going to look into that. (not a problem of this issue).
=======
starting to look at the test only, just a little clean up. (See https://www.drupal.org/node/1354 for some standards things.)
(note #4 is not really test_only. :) )
@Désiré For instructions on creating an interdiff, see https://drupal.org/documentation/git/interdiff | Microbranching workflow: http://xjm.drupalgardens.com/blog/interdiffs-how-make-them-and-why-they-...
Comment #7
Désiré CreditAttribution: Désiré commentedHere is the current, working solution which somehow breaks the test...
Comment #10
Gábor HojtsyIs this not supposed to be $item->getLangcode()? That is what the entity_view() code does in entity reference.
Do not capitalize Lang and Code separately, just Langcode as one.
Target langcode for translation.
Comment #11
Désiré CreditAttribution: Désiré commentedUpdates after #10
Comment #12
YesCT CreditAttribution: YesCT commentedmaybe we can do id() or getId().
working to find what type of thing this is.
we should keep this.
https://www.drupal.org/node/608152
Comment #13
Désiré CreditAttribution: Désiré commentedHere is the last version with the fixed test (thank you Gabor), and with some minor improvements after the review with YesCT.
Comment #17
YesCT CreditAttribution: YesCT commentedI read through the whole patch.
The test is testing what it should, and fails just in the right ways.
removing the needs tests tag.
The fix makes sense.
This looks ready to go to me.
Comment #18
webchickCommitted and pushed to 8.x. Thanks!
Comment #20
webflo CreditAttribution: webflo commentedThis should fix head after #2344821: Unify 'name' / 'field_name' in FieldConfig / FieldStorageConfig got in.
Comment #21
tim.plunkettComment #22
Gábor HojtsyCommitted. Thanks! Its unfortunate #2344821: Unify 'name' / 'field_name' in FieldConfig / FieldStorageConfig did not get retested (in time) and the combination of the two committed broke.
Comment #25
swentel CreditAttribution: swentel commentedSlow testbot :)