Problem/Motivation
In Drupal 6, you can use the I18n Taxonomy module to translate a taxonomy vocabulary and taxonomy terms. There are two different multilang concepts: 'localized' and 'per language'. This issue is about the 'localized terms' concept.
The 'Localized terms' concept is explained at https://www.drupal.org/docs/8/upgrade/upgrading-multilingual-drupal-6-to...
Proposed resolution
Scope of this issue is to migrate D6 taxonomy term translations. In practice:
- Have a vocabulary in D6 with 'Localized terms' setting.
- Create a term in this D6 vocabulary.
- Translate the term title and description in D6 at admin/build/translate
- Expected result and scope of this issue: The translation of the term is migrated to Drupal 8.
Out of scope for this issue:
This issue is only about migrating the term translations as described above.
- The settings for the D8 vocabulary are handled in #2975509: Migrate D6 vocabulary language settings
- It is quite typical in Drupal 6 that the multilingual taxonomies are combined with node translations. References from the nodes to the terms are handled in #2859297: Migrate taxonomy term references for D6 Node translations
Remaining tasks
a) Make a patch with tests.
b) Test manually. jhodgdon's test instructions are in comment #12.
c) Fix the Postgres / SQLite issues
d) Commit.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Original issue description by @jhodgdon
- You mark a particular vocabulary as having translatable terms. (In my site, I had one that was marked as translatable and one that wasn't).
- If you go to the taxonomy page, like admin/content/taxonomy/5, you cannot see the translated taxonomy terms. But you can translate them by going to the central UI (locale) translation page (admin/build/translate), so the translated terms are stored in the same database tables as the UI translation strings. To translate, click on Search, and filter by Taxonomy, and if you have the i18n_taxonomy module enabled, you will see the translatable taxonomy terms there to translate.
- After translating, if you view a translated node with one of the terms on it, and view it in Spanish, the term will show up in Spanish. Also, I made a block view that lists the tags (the translated vocabulary), and when viewing the site in Spanish, this block shows up in Spanish also.
- In the D6 database:
- term_data has the taxonomy term information
- i18n_strings correlates term IDs to locale string IDs
- locales_target has the actual translations in it
Here's a query that illustrates the relationships:SELECT td.tid, td.name, lt.language, lt.translation FROM term_data td LEFT JOIN i18n_strings ist ON td.tid = ist.objectid LEFT JOIN locales_target lt ON ist.lid = lt.lid WHERE ist.type = 'term'
At this time, taxonomy terms translated in this way cannot be migrated into Drupal 8. If you have a Drupal 6 site with this setup, you get the English terms migrated in, and the English name for the vocabulary, but the translations are not migrated. The resulting site has the following in the database, after migrating from an actual D6 site with internationalized taxonomy terms (one vocabulary with English/Spanish terms, and one with just English terms):
- Table migrate_message_d6_taxonomy_term_translation is there but empty, so Migrate thinks it did the translation migration with no messages.
- Table migrate_map_d6_taxonomy_term_translation has 36 rows. 36 is the total number of taxonomy terms on the d6 site. 23 were from the translated vocabulary. The other 13 from the untranslated vocabulary.
- Table taxonomy_term_field_data has 36 rows. Each one is an English taxonomy term. The langcode field is blank for all entries. There are no Spanish entries.
Note that #2784371: Migrate D6 i18n taxonomy term language (but not yet translations) migrated term language, and #2225781: Migrate D6 i18n taxonomy vocabularies migrated vocabulary language, but neither of them migrated translations. Also, once this is done, we can look at also making sure the translated nodes get the translated taxonomy terms, on #2859297: Migrate taxonomy term references for D6 Node translations.