backdrop-contrib / i18n

Collection of modules to extend Backdrop CMS multilingual capabilities
https://backdropcms.org/project/i18n
GNU General Public License v2.0
2 stars 5 forks source link

Migrate i18n_block data #35

Closed herbdool closed 3 years ago

herbdool commented 4 years ago

Part of https://github.com/backdrop-contrib/i18n/issues/33

"Needs a migration path from locale db tables to block.custom.[name].json (custom blocks only), Needs to run after system 1025 (see: hook_update_dependencies())."

This is what translated blocks look like in core right now (forgive my poor Dutch):

{
    "_config_name": "block.custom.my_english_block",
    "delta": "my_english_block",
    "info": "My english block",
    "title": "English!",
    "description": "",
    "body": {
        "value": "<p>Read my English words and behold!</p>\r\n",
        "format": "filtered_html"
    },
    "default_langcode": "en",
    "translations": {
        "nl": {
            "info": "Mijn nederlandse blok",
            "description": "",
            "title": "Nederlandse!",
            "body": {
                "value": "<p>Lezen op mijn nederlandse tal!</p>\r\n",
                "format": "filtered_html"
            }
        }
    }
}

I had to remind myself how we implemented it in core. Should also document here how it's done with i18n_block.

indigoxela commented 3 years ago

Covered by this change: https://github.com/backdrop-contrib/i18n/compare/d7-upgrade-path#diff-2ddff3f41a5325255e0afb5845ae9e88cee6059403d1a8af6132e5ad6ecfedc0R183

indigoxela commented 3 years ago

Fixed with the merge of branch d7-upgrade-path.