Problem / motivation
Drupal 6
Drupal 6 supports two different concepts for multilingual taxonomies.
- 'Localize terms' concept means that there is on term ID where term name / description can be translated. Migration of these terms was handled in #2886609: Migrate translations for D6 i18n taxonomy 'localized' terms.
- 'Per language terms' concept means that for a bilingual site, there will be two different term IDs and these two term entities are linked as translations of each other. This issue is about 'per language terms' concept.
The data model in D6 'per language terms' is illustrated in the picture below.
- We have one article which has two language versions in D6, one for English and one for Finnish.
- In D6 i18n concept, these are two different node entities with their own nids. The two nodes are linked as translations of each other.
- When the vocabulary uses the 'per language terms' concept, also the language version are separate entities with their own tids. The two terms may be linked as translations of each other but there can be terms that do not have linked translations.
- In this example, the English nid 1 is pointing to the English tid 1 and the Finnish nid 2 is pointing to the Finnish tid 2.
Drupal 8, option D8A
The Drupal 8 taxonomy can be set up in many different ways.
One option, which we call D8A here, is to set up the taxonomy as illustrated in the picture below.
- Here we have only one node entity (nid 1).
- The content type has two translatable fields (title and body) and we have English and Finnish content for these fields.
- The important part here is that we still have only one node entity i.e. the English and Finnish translations both share the nid 1.
The vocabulary can be defined in D8 with the similar concept as node.
- The taxonomy term has two translatable fields (title and descriptions) and we have English and Finnish content for these fields.
- The important part here is that we still have only one term entity i.e. the English and Finnish translations both share the tid 1.
The relation from node to term is 'for all languages' i.e. the node is just pointing to term/1 but the term 1 can have multiple language versions as described above.
Conclusion: the concept D8A is a essentially an equivalent to D6 'Localize terms' concept. This issue is about the D6 'per language terms' which is conceptually very different and the D8A is not suitable D8 setup for this.
Drupal 8, option D8B
We concluded above that the concept D8A is NOT what we want to achieve as a result when the D6 source uses the 'per language terms' concept. Let's see what is the closest equivalent how D8 can be set up.
It is possible to define the D8 data model so that the taxonomy term field that we have on a node content type can be translated. Let's call this option as D8B. This scenario is illustrated in the picture below.
- Here the taxonomy term field of the content type is NOT 'for all languages' but the field can be translated like title and body.
- This means in practice that the English language version of node/1 can point to term/1 and the Finnish language version of node/1 can point to term/2.
- This is as close as we can get to the D6 data model but there is one key difference: In D6 the two terms (term/1 and term/2) may be linked as translations of each other (but they may also be independent of each other) . In D8 data model the two term entities cannot be linked as translations of each other, they are always independent terms.
Test results on what we currently have in D8.6.x-dev
1. Vocabulary settings are not migrated. There is an open issue for this so we don't need to do anything under this issue. However, my evaluation here provides the needed conceptual input how the vocabulary settings need to be migrated but I'll update the findings to that issue. See #2975509: Migrate D6 vocabulary language settings.
2. The languages of the individual terms are correctly migrated already. No changes are needed to this. However, we need to update the Known Issues page with information that the D6 term entities will not be linked as translations of each other. Tagging for docs so that I won't forget to do that.
3. The taxonomy term reference field on the content type has the 'Users may translate this field' setting enabled as expected already. So no changes needed for this either.
4. The actual reference from nodes to terms is only migrated for the default language of the node. There is an open issue for this as well, see #2859297: Migrate taxonomy term references for D6 Node translations. I will add my findings to that issue so that we can have the references for 'per language terms' references covered in that issue.
All in all, the only thing that needs to be changed is to fix the already existing two issues and explain the conceptual difference to the Known Issues page (i.e. that the terms cannot be linked as translations of each other in D8).
Remaining tasks
Add findings from this issue to the already open two issues.
Update the Known Issues page.
I'll leave this open until I've done the tasks above but no patch needed to this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2979486-d8b-2.PNG | 12.77 KB | masipila |
| #11 | 2979486-d6-2.PNG | 10.06 KB | masipila |
| #3 | 2979486-d8a.PNG | 9 KB | masipila |
Comments
Comment #2
masipila commentedComment #3
masipila commentedComment #4
masipila commentedComment #5
masipila commentedComment #6
masipila commentedPhew, issue summary now describes the situation over here. I tagged this as migrate critical for the time being as we are talking about migration of multilingual content. This issue needs discussion in the migrate weekly call.
Comment #7
gábor hojtsyThe D6 UI says that different terms are allowed for translations though. This is the feature where different translations do not require the same terms/concepts applied, no? So terms MAY be translated (as per the D6 UI text) but they may not.
Comment #8
quietone commented@masipila, thanks this looks great. I haven't read this thoroughly yet. My immediate thought was is how do the already committed issues fit into this picture, #2784371: Migrate D6 i18n taxonomy term translation (but not yet localized translations) and #2225781: Migrate D6 i18n taxonomy vocabularies? I don't know the answer and can't look for a few days.
Comment #9
masipila commentedRe: #7 Correct. The D6 terms are different term entities in D6. The terms may be set as translations of each other or they can be independent terms that do not know anything about each other.
Comment #10
masipila commentedUpdates to IS after background processing this while sleeping. I will continue evaluating this.
Comment #11
masipila commentedComment #12
masipila commentedComment #13
masipila commentedIssue summary updated. No patch needed to this issue. Phew. :)
Comment #14
masipila commentedFixed image URLs
Comment #15
masipila commentedComment #16
quietone commented@masipila, excellent issue summary. I have a much better understanding of the D6 source now.
Comment #17
masipila commentedFixed typos in issue summary.
Comment #19
quietone commentedAdd tag.
Comment #20
masipila commentedClosing this issue as no patch is needed here. The documentation handbook has been updated, see https://www.drupal.org/docs/8/upgrade/upgrading-multilingual-drupal-6-to...
The results of this analysis have been added to #2859297: Migrate taxonomy term references for D6 Node translations