1

I have an older EE2 site that will be rebuilt and not upgraded. There are almost 150 translations in the Transcribe module. Is there an easy way to export via db query or template code a list of variables and translations somehting like this:

  • variable_1 English French,
  • variable_2 English French,
  • variable_3 English French,
  • variable_4 English French,

This would save a lot of copy/pasting.

Digging into the database I see two tables that I need to combine to output the data correctly. I am completely unfamiliar with mysql so have no idea where to start.

exp_transcribe_variables and exp_transcribe_translations

Translations has a column variable_id which should match the variables column id see screenshots from navicat

enter image description here

enter image description here

1 Answer 1

2

You can export the data from the EE MySQL database if you have access to a MySQL utility such as Sequel Pro or Navicat.

You'll need to enter some SQL to isolate the data you want, something like this:

SELECT
    t_variable.id AS entry_id,
    t_variable.name AS entry_name,
    t_translation.content AS entry_content
FROM exp_transcribe_variables t_variable
INNER JOIN exp_transcribe_translations t_translation ON (t_variable.id = t_translation.variable_id)
INNER JOIN exp_transcribe_variables_languages t_language ON (t_variable.id = t_language.variable_id)
WHERE t_language.language_id = '2'

This will generate a table with the translations in... hopefully... that you can then export as CSV or whatever works for you :D

2
  • This project finally got a go ahead. Getting this into a format to use with Craft CMS was simple using the above. Exported from DB as a txt file after I removed line 2 as it wasn't needed and then did a find/replace for " to ' and then another for ' ' and finally a regex of ([^\n])$ to ', which added a comma to the end of each line
    – CreateSean
    Commented May 8, 2019 at 16:21
  • 1
    Congrats. Unlucky that you have to move it to Craft though - twig === icky and expensive too! Still I guess that's where the trendy kids are right now... good luck with it :) Commented May 8, 2019 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.