Support » Plugin: Gutenberg » translating blocks (wp_set_script_translations, setLocaleData) not loading .json

  • Resolved fabiankaegy

    (@fabiankaegy)


    I’m facing difficulties when trying to successfully translate the JavaScript inside my Gutenberg Block. Regarding to everything written in the documentation, the small plugin here should work and load it’s translation. But it doesn’t and I can’t seem to troubleshoot it any further.

    The code function retunes true and I get a new script tag inside the header. But the data passed to the wp.i18n.setLocaleData function is not matching what is inside the .json translation file.

    And even if I execute the wp.i18n.setLocaleData function myself and pass all the data in directly as a string it does nothing.

    I’m not sure wether it is something wrong with my code, the documentation or the actually way this is supposed to work.

    Any help is much appreciated 🙂

    • This topic was modified 8 months, 1 week ago by  fabiankaegy.
    • This topic was modified 8 months, 1 week ago by  fabiankaegy.

    The page I need help with: [log in to see the link]

  • The topic ‘translating blocks (wp_set_script_translations, setLocaleData) not loading .json’ is closed to new replies.