• Resolved Yash Kapoor

    (@yash429)


    Hello,

    As I am using a developer version of WooCommerce Admin plugin but when I run the command npm run i18n in order to generate woocommerce-admin.php and woocommerce-admin.pot file in languages folder.

    There seems to be the mapping of php files present in .pot file but js mappings are missing. So if I create .po and .mo files with that .pot file, no js mappings are present in them so when I run wp-cli command to create .json file, success message shows with created 0 files.

    I have also checked out this link https://translate.www.ads-software.com/projects/wp-plugins/woocommerce-admin/, when I download .po file from here, js mappings are present.

    In order to create this .po file, first I need .pot file with all proper mappings. Kindly let me know if there is any way to create those all by my own.

    Thanks for help.

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

Viewing 1 replies (of 1 total)
  • Plugin Author psealock

    (@psealock)

    thanks for the question @yash429 !

    It looks like the npm run i18n command is several commands combined.

    `
    “i18n”: “npm run -s i18n:js && npm run -s i18n:php && npm run -s i18n:check && npm run -s i18n:pot”,
    `

    If you run them individually, it looks like the php overwrites the js. In other words, you can generate the js individually with npm run -s i18n:js.

    I hope this help you to generate the js manually! In the meantime, here is an issue to track the progress of a fix.

    https://github.com/woocommerce/woocommerce-admin/issues/3298

Viewing 1 replies (of 1 total)
  • The topic ‘@wordpress/i18n – How to translate JS strings’ is closed to new replies.