• Resolved zuyki5

    (@zuyki5)


    Hi,

    I enjoy using this plugin a lot.
    The standard string translations using qtranslate-x plugin also works, although there is one strange thing and I think there should be a solution for it. There are the fields in Settings -> Template for customizing “Shop Name”, “Shop Address”, “Footer: terms & conditions, policies, etc.”, “Extra fields 1/2/3” that do not support general qtranslate-x syntax which is [:en]english string[:de]german string[:]
    My question is: do you have any solution already, will it be inmplemented in the next updates OR should I edit the template myself and insert php code to make the invoices be rendered in multilingual format for those fields?
    By the way I do not prefer WPML.

    Thank you.
    Great plugin!

    https://www.ads-software.com/plugins/woocommerce-pdf-invoices-packing-slips/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    I haven’t worked with qtranslate-x, and because multi-lingual support is quite complex I have currently limited support to WPML via the Professional extension. I’m willing to expand this to qtranslate-x, send me an email at [email protected] and I’ll see what I can do for you.

    Alternatively, you could also use the filters for these settings fields and then ‘hardcode’ the values (which is cleaner than editing the templates).

    These are the filters for those texts:

    • wpo_wcpdf_shop_address
    • wpo_wcpdf_shop_name
    • wpo_wcpdf_footer
    • wpo_wcpdf_extra_1
    • wpo_wcpdf_extra_2
    • wpo_wcpdf_extra_3

    Hope that helps!

    Thread Starter zuyki5

    (@zuyki5)

    Hi Ewout,

    Thank you for your reply.
    The hardcoding was not necessary since I used a logic “do not invent the bicycle” (when it is already invented) ??
    The trick is very simple actually. All of us who use qTranslate-X and WooCommerce plugins are forced to use a free plugin “WooCommerce & qTranslate-X“. In that particular plugin on file ‘qwc-front.php’ we have the arrays of all the WooCommerce filters which do not support the qTranslate-X plugin, they are categorized by one-argument, two-argument, three-argument and four-argument filters so all I had to do there was to add all of your listed filters accordingly to the number of arguments used.
    As well the user language was not parsed for the following:

    • wpo_wcpdf_order_items
    • wpo_wcpdf_payment_method
    • wpo_wcpdf_shipping_method

    and probably some other additional filters which I do not see due to the configuration and simplicity of my WooCommerce case.

    I recommend you to add the same trick in the upcoming update of the free version of your wonderful plugin or at least include this information (in a more user-friendly way than I wrote) at your plugin’s FAQ or readme.

    Anyway I will probably have to contact you when I will buy the PRO version of your plugin to add an abbility of the receipt (which is same as invoice but with the “receipt” strings instead of all “invoice” containing strings and a different filename, in simple words just a second version invoice with a different title/strings which should be sent after the payment is complete) related to some specific countries (or most of the countries where companies require a VAT Receipt after the payment for their accountancy use) which I could implement myself but I am busy and lazy ??

    Also I will try to make Lithuanian, Latvian translations and update the Russian. I hope to do this in a month time and send it over for you.

    Again I want to compliment you for a great plugin and a high level of support. Much appriciated!

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! Thank you so much for sharing this information!

    Can you please send me an email at [email protected] so I can add this to the plugin? Looking at qwc-front.php, I think there are also ways to add these filters without editing the file, but I don’t have a site to test this on. Thanks!

    Ewout

    Thread Starter zuyki5

    (@zuyki5)

    Hi Ewout,

    Thank you for your reply again and a great support, I am happy to be helpful and you are welcome to have this information ??

    One more thing I forgot is that the back-end also requires attention, so on file ‘qwc-admin.php’ of the “WooCommerce & qTranslate-X” plugin I also added the same list of all the filters to support the multilanguage in admin mode while generating and downloading the invoice file.

    There is only one bug which I noticed and still could not work out is that sometimes when admin downloads the PDF manually from admin ‘Orders’ page, the qtranslate-x formatted (as the format is [:en]english string[:de]german string[:]) values of

    • wpo_wcpdf_shop_address
    • wpo_wcpdf_shop_name
    • wpo_wcpdf_footer

    and probably other variables are rewriten back to the single language (plugin removes the shortcodes and leaves only the admin’s requested language when generating the invoice), probably that which was used by the buyier (user) OR the admin (since the admin uses different language than user) I am not sure in which case exactly. I am sure this could be fixed as it is a minor issue, but I do not know yet when it happens exactly.

    I will send you an email with updated translation (.po) files and as well the added filters into ‘qwc-front.php’ and ‘qwc-admin.php’ files which were actually nothing special and very simple but I also agree that there is a very simple way to add the qtranslate-x support into upcoming release of your plugin, I only added the temporary solution.

    Unfortunately my WooCommerce website is not public yet as there are still some things to work on and it has no English language at the moment as the translations of the content are not made yet by a third party but after it will be on public domain for sure I am willing to share it.

    Still a correct way for implementation should be found and some fixes for an admin mode should be done so I am not closing this topic as resolved yet, but it is almost resolved ??

    By the way the same is for plugins qTranslate, mqTranslate and all related plugins (like qTML, IM8 qTranslate WooCommerce and few other child plugins) but they are out of date and all who use them gets the message that mqtranslate is not supported anymore and everyone should migrate to qtranslate-x which I believe most of the qTranslate and mqTranslate users have already done or they will be migrating to the qtranslate-x in the nearest future.

    Regards
    zuyki5

    Thread Starter zuyki5

    (@zuyki5)

    As well there is an issue but it is more related to the WooCommerce itself related to the user language and there is nothing you can do about it, just FIY.
    When buyier (user) makes an order, some of the variables like wpo_wcpdf_payment_method, wpo_wcpdf_shipping_method and few other like date (month strings) are parsed in user language (which the user was using when made an order) and those values can not be changed if for example admin requests (generates) an invoice file in another language which he preferes for accountancy, but as I already said you can not do nothing about it as those values are stored in user’s language on the database of the WooCommerce orders. Anyway it might be related to the admin bug which I explained on the previous post, I hope to find it and report to you later (this September) as I am working on something completely else at the moment.

    Regards
    zuyki5

    Plugin Contributor Ewout

    (@pomegranate)

    Thank you so much! I have received your email and will get back to you later this week or early next week – I want to properly take my time for doing this to make sure I do it right ??

    Plugin Contributor Ewout

    (@pomegranate)

    Fix will be included in the next release (see commit e6b1029)

    have a great day!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘qtranslate-x plugin support’ is closed to new replies.