Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

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

Open
stouch opened this issue Aug 5, 2021 · 3 comments

Comments

@stouch
Copy link

stouch commented Aug 5, 2021

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 ?

@rijkvanzanten
Copy link
Contributor

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?

@stouch
Copy link
Author

stouch commented Aug 5, 2021

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.

@skuhnow
Copy link

skuhnow commented Apr 22, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants