Skip to content

make-json: generated file missing theme textdomain prefix #197

@mcguffin

Description

@mcguffin

Bug Report

I'll keep it brief – might hopefully save someones time. ;)

Translations folder in a theme – just as expected by load_theme_textdomain():

languages/
    theme-slug.pot
    de_DE.po
    de_DE.mo

CLI Command

wp i18n make-json languages/*.po --no-purge

The result

languages/
    theme-slug.pot
    de_DE.po
    de_DE.mo
    languages/de_DE-a0623ef93657e56554c5ddda522ed690.json

The translation will not load.
wp_set_script_translations() expects the file to live in {textdomain}-{locale}-{md5}.json.
After renaming it accordingly the translation loads.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions