Support » Plugin: Force Update Translations » Is it even possible to generate the relevant json files for JS translations?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Pedro Mendonça

    (@pedromendonca)

    Hi,
    This plugin currently only downloads the .po and .mo files from translate.wp.org.
    GlotPress does not provide these .json for JS translation.
    Yes, it is possible to generate them, currently this plugin do not support it.
    I agree, maybe it should be mentioned in the readme.

    @mayukojpn 🙂

    Plugin Author Mayo Moriyama

    (@mayukojpn)

    @tobifjellner @pedromendonca Thanks for the report and the suggestion! I added the description on readme. I’ll check if it’s possible to load JSON file from GlotPress!

    Plugin Contributor Pedro Mendonça

    (@pedromendonca)

    GlotPress exports a single JSON with all the strings.
    WordPress JavaScript needs several JSON files, one per source .js file, with a hash name to uniquely identify its source file.
    I’ve made it possible to generate JSON files from .po files for WordPress Core on the plugin Translation Tools, maybe we could pack that funcionality in Force Update Translations for plugins and themes.

    Plugin Author Mayo Moriyama

    (@mayukojpn)

    @pedromendonca You always have done what I am going to do. 😂 Let me check your plugin! Thanks a lot as always!!!

    Plugin Contributor Pedro Mendonça

    (@pedromendonca)

    Check out WP-CLI/i18n-command, it uses php-gettext to extract and map JS strings from the .po files. Then it exports and saves all the needed files.

    That’s where I found the solution. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.