-- P5-6282: use text tags for category translations

insert into "i18n-texts" (name, category)
    select slug, 'article_categories' from article_categories;


insert into "i18n-texts_data" (textid, text, locale_id)
    select
        (select textid from "i18n-texts" where name = article_categories.slug and category = 'article_categories'),
        article_categories_translations.name,
        (select locale_id from market_locales where market_id = article_categories_translations.market_id)
    from article_categories_translations
    join article_categories on article_categories_translations.category_id = article_categories.id;


drop table article_categories_translations;
