• Resolved JeanP

    (@jeanp)


    I want to copy the custom translation from one website to multiple other websites via ftp. I have downloaded and uploaded the following translation files from and to /languages/loco/plugins folder:

    woocommerce-nl_NL.mo

    woocommerce-nl_NL.po

    woocommerce-nl_NL.l10n.php

    I see that after uploading these files and visiting the checkout, the JSON files in the /languages/loco/plugins folder are not updated.

    Only after I make an edit and safe the translation within Loco translate the JSOn Files are updated.

    Is there a way to create the JSON files programmatically without having to edit the translation file in Loco Translate?

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

    (@timwhitlock)

    Saving the PO file is the only way to invoke compilation of dependant files.

    No processes run in the background. This is on purpose, and for numerous reasons.

    Thread Starter JeanP

    (@jeanp)

    Thank you Tim for your quick answer. So saving the file in Loco Translate is the only way? After uploading I see the PO file correctly in Loco Translate.

    So there is no way to safe the file trough Loco Translate remotely? I have to update the custom file to alt least 10 websites. So logging in and saving them after upload with ftp is a lot of extra work. I would like to automat is. Is there a hook available to save the PO compose the jsons?

    • This reply was modified 5 months, 3 weeks ago by JeanP.
    Plugin Author Tim W

    (@timwhitlock)

    There are no hooks for this.

    My only suggestion is to use the WP CLI command: loco sync, but be aware that this will update the PO file, so you’ll need to be sure whatever it syncs to (e.g. POT) is correct.

    I should probably add a “loco compile” command, but currently this is all there is.

    Thread Starter JeanP

    (@jeanp)

    The loco compile command would be a very helpful addon for me. Would you consider implementing it?

    Plugin Author Tim W

    (@timwhitlock)

    Yes, I will.

    I have to ask – If you’re updating your custom PO file on 10 websites, why not also update the MO and JSONs? Why not just upload all the files you need on the target server, so you can guarantee they’re all in sync.

    Thread Starter JeanP

    (@jeanp)

    Thank you Tim.

    So you mean that I can download all woocommerce translation files from /languages/loco/plugins from the main website like: woocommerce-nl_NL.mo, woocommerce-nl_NL.po, woocommerce-nl_NL.l10n.php and the compiled JSON files?

    And than upload these exact files to the same directory of the other websites?

    Do I need to delete the old Woocommerce translation JSON files files first if I upload the new translation files?

    Plugin Author Tim W

    (@timwhitlock)

    Yes. They’re just ordinary files sitting on your server. The compilation process does nothing special on the host system other than create the files.

    As with copying any directory, it makes sense to delete redundant files from the target.

    Thread Starter JeanP

    (@jeanp)

    I just implemented what you have told me and it works like a charm! Thank you Tim!

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