migration-tool icon indicating copy to clipboard operation
migration-tool copied to clipboard

Migrating translations : What about the parsing of languages code (ex: "fr", "en") to languages ids ?

Open stouch opened this issue 4 years ago • 3 comments

Hello,

In V8, to translate the contents I made something like that (in my memory it was a good practice) :

page (id, translations (translations with id<->page_translations.page)) page_translations (id, page (int), language_code (language))

So, when I finally succeeded to import my data to the V9 with the migration-tool, I noticed that my collections kept this old schema, and there didn't had any conversion to the new schema with language_id etc of Directus v9.

So, I don't have any idea of how I'm going to restore all my translations because now they do not appear at all (blank space below "Translations" for exemple in each of my page items).

Is it something that someone is working on ?

stouch avatar Aug 05 '21 13:08 stouch

So, I don't have any idea of how I'm going to restore all my translations because now they do not appear at all (blank space below "Translations" for exemple in each of my page items).

Any errors in the app dev tools? What did the schema look like exactly in v8, and what is the end result in v9?

rijkvanzanten avatar Aug 05 '21 13:08 rijkvanzanten

Before :

before_page_translations before_pages

After :

after_page_translations after_pages

And I've finally that :
Capture d’écran 2021-08-05 à 17 29 12

EDIT: I also noticed that when I created a fresh collection to test translations in V9, that this appears (which is not on my imported collections) : Capture d’écran 2021-08-06 à 21 17 31

If you need anything else, do not hesitate to ask me.

stouch avatar Aug 05 '21 15:08 stouch

I have the same problem. Migrated, but no working translations.

I works with these post migration steps

  1. create languages table (created a test collection and an translation field so that the correct directus_collection entries are created)
  2. set special and interface to translations inside your directus_fields table for your translation field in your main table
  3. remove the original, empty translations field in your main table (per drop field; not in directus)
  4. create directus_relations relations (used the relation from my test-collection from step 1)
  5. inserted all old language codes (in v8 it was de or en) in my languages table so that i can create a real foreign key in step 6.
  6. create a FK in my translation table. also used my test_translations collection as a template

skuhnow avatar Apr 22 '22 11:04 skuhnow