• I can add plugin source strings from PHP and JavaScript successfully, but there is no option in the plugin settings which allows me to specify that block.json files should be parsed. This is, however, possible using wp i18n make-pot, so it would be great if this could be added to Loco Translate.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tim W

    (@timwhitlock)

    Thanks for the suggestion. String extraction from JSON files is not supported, and JS parsing is severely limited.

    I am not familiar with block.json or how it’s localised, but I generally recommend that wp i18n make-pot is used for script extraction, as noted here.

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    Thanks Tim. We’ve been using JS and JSX extraction via Loco Translate in all of our projects (themes and plugins) since 2020 and haven’t encountered any issues. If this isn’t a solution you’ll be progressing, I’ll be happy to find an alternative solution.

    Plugin Author Tim W

    (@timwhitlock)

    I’d be happy to look at supporting JSON, but I was completely unaware this was a localisable format in WordPress. If you can post any useful links about this I will investigate.

    I don’t plan to improve JavaScript extraction due to the many problems I run into every time I look into it. When a better tool exists in the WordPress ecosystem I’d recommend using it, but I’m glad to hear my tool works for you.

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot scan block.json files’ is closed to new replies.