• Resolved geitsupport

    (@geitsupport)


    We have been trying to come up with a way to edit the order note that is created when an item is shipped. The work around that woocommerce recommended was to use your plugin to translate the note to read the way we want it to read. I have installed the plugin and I believe I have the files set up correctly.

    from what I can tell, .mo, .po, and .pot files are set up correctly.

    Any suggestions you can give would be appreciated.

    thanks.

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter geitsupport

    (@geitsupport)

    UPDATE: If I try to translate an already existing row in the translation file I see the results I expect. When I try to create a new row I have problems.

    Thread Starter geitsupport

    (@geitsupport)

    Here is the code that I have added to the .pot file and .po file for this plugin

    #. Shipment Order Note
    #: includes/api-requests/class-wc-shipstation-api-shipnotify.php:268
    #, php-format
    msgid “%1$s shipped via %2$s on %3$s with tracking number %4$s”
    msgstr “Your order shipped via %2$s on %3$s with tracking number %4$s”

    I did this based on the following code that also existed in both the .po and .pot files

    #. 1) number of shipped items 2) total shipped items 3) order ID
    #: includes/api-requests/class-wc-shipstation-api-shipnotify.php:284
    #, php-format
    msgid “Shipped %1$d out of %2$d items in order %3$s”
    msgstr “Your order was shipped via %2$s on %3$s with tracking number %4$s”

    If I edit the php file referenced in both spots I can see that the second translate works.

    Any advice you can give would greatly be appreciated.

    Thread Starter geitsupport

    (@geitsupport)

    The text I am trying to translate is a row that I had to add. Is the problem that your plugin was unable to pick up that string initially? Does that fact that I had to add it mean, that the plugin is unable to find that string to do the replace? Any help you could offer would be greatly appreciated.

    thank you.

    Plugin Author Tim W

    (@timwhitlock)

    Never modify msgid fields. This is not how to customize text and it won’t work.

    If you want alternative English text, just create an English->English translation.

    Thread Starter geitsupport

    (@geitsupport)

    That’s what I’m trying to do.

    The line of text I wanted to translate didn’t appear in the initial file so I created a new entry for the line that text.

    Plugin Author Tim W

    (@timwhitlock)

    I’m not following. Did you add a new msgid or not?

    Thread Starter geitsupport

    (@geitsupport)

    Yes. I added a new message ID. I wanted to “translate” –>

    %1$s shipped via %2$s on %3$s with tracking number %4$s

    to

    “Your order shipped via %2$s on %3$s with tracking number %4$s”

    there was not a message id for “%1$s shipped via %2$s on %3$s with tracking number %4$s ”

    so I created one.

    Here is the code for the newly created entry

    #. Shipment Order Note
    #: includes/api-requests/class-wc-shipstation-api-shipnotify.php:268
    #, php-format
    msgid “%1$s shipped via %2$s on %3$s with tracking number %4$s”
    msgstr “Your order shipped via %2$s on %3$s with tracking number %4$s”

    Plugin Author Tim W

    (@timwhitlock)

    OK, I’ve downloaded your plugin to try and understand what’s going on here.

    The woocommerce-shipstation plugin uses a bunch of translations from the main woocommerce plugin (including your example string on line 268). This is why the string isn’t extracted by Loco Translate – it belongs to another plugin.

    However, your example string isn’t actually present in the latest version of woocommerce, so it’s either a mistake in the plugin PHP code, or the plugin is using strings from an older version of the main woocommerce plugin. Either way, this is not a fault in Loco Translate and you should report the erroneous strings to the author as a bug.

    Adding the missing strings manually into the woocommerce-shipstation files will never work because WordPress will try to load them from woocommerce files instead.

    Thread Starter geitsupport

    (@geitsupport)

    Thank you for the explanation. I’ll contact woocommerce and see what they say.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘ShipStation Translation’ is closed to new replies.