WordPress.org

Forums

qTranslate X
[resolved] Make attribute names translatable (18 posts)

  1. Steffen Ehrmann
    Member
    Posted 8 months ago #

    When translating my webshop, I am also interested in translating categories, tags and attributes to the products I want to offer.

    Say I want to add an attribute "Background" to my product with terms "glossy, matte, canvas, etc", this should than be "Hintergrund" in german with terms "Glänzend, Matt, Leinwand, etc".
    Translating the terms is no problem, but unfortunately I did not find an option to also translate the attribute name from "Background" to "Hintergrund".

    I have the impression that this could be fixed rather easily.

    Thanks for making translations also for woocommerce easily available! This plugin did the trick for me, after trying to fix too many problems with "qTranslate Plus" et al.

    https://wordpress.org/plugins/qtranslate-x/

  2. John Clause
    Member
    Plugin Author

    Posted 8 months ago #

    Hi Steffen, I am not sure, what you mean, I have to play with woocommerce, I guess. Which plugin exactly do you use?

    Have you tried to use [:] tags in those fields? Please, read FAQ and description, if you do not know what I mean. Let me know if you figure it out. Thanks!

  3. Steffen Ehrmann
    Member
    Posted 8 months ago #

    Hi John,

    ah sorry, I thought you are familiar with woocomerce. Yes, I tried to use the [:]-notation, but unfortunately it does not work.

    When you add a product to woocommerce you can assign categories and tags to it as we are used to it from vanila wordpress. But additionally you can add attributes which describe a certain model or style of the product. If you want to sell a shirt in blue and yellow, blue and yellow would be the attributes and "colour" would be the attribute name. Unfortunately this attribute name is not translatable.

    Thanks for looking into this!
    Steffen

  4. Steffen Ehrmann
    Member
    Posted 8 months ago #

    Unfortunately the 2.9.1 bugfix did not help it. Here is a link to the respective page: http://www.ehrmann-photography.de/?product=41&lang=en. Maybe this is a theme-bug?

    I tried to set the id "attribute_label" as Custom-fields id (this is the id the field has in the admin-panel when setting attribute names. Also the class "product_label" (the class this text has on the website does not show an effect.

  5. Steffen Ehrmann
    Member
    Posted 7 months ago #

    bump

  6. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    There is a number of plugins which are supposed to make woocommerce compatible with qTranslate(-X). For example, "qTranslate support for WooCommerce" "IM8 qTranslate WooCommerce", "WooCommerce-qTML". You have to use them with the latest version from GitHub, which can be downloaded from there (look for button Download), or click here for the sake of convenience. It currently gets updated very frequently, it is better to sign up for notices from github for this repository.

    However, it seems that none of them solves all the problems.

    We are currently working with one user on his woocommerce installation, and he says there is one only problem left for him (sending confirmation e-mails). Once he is fully ok, we will know how to set it up, and will of course, share it with you. Thanks a lot.

  7. franticpsyx
    Member
    Posted 7 months ago #

    WC-qTML just received an update for WC 2.2 - localization of e-mails should now work again. WC 2.2 changed a few things with po-mo files, which should now reside in the WP_LANG_DIR/woocommerce directory.

    The plugin is not maintained actively these days, but I frequently check pull requests and issues at https://github.com/franticpsyx/woocommerce-qtml . So if anyone wants to contribute to the code in any way, feel free.

  8. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    @steffen-ehrmann: The very latest from github has some more modifications towards woocommerce integration, although I doubt that it will help your problem, but who knows, maybe.

    I have just made Woocommerce work for one of the users, he gave me access to his site and a modification of woocommerce code was required, but not with respect to what you describe. I am in contact with woocommerce on the issue. If you still have problem, you may give me a login to a test-copy of your site (qtranslateteam at gm a il d co m), where I could do any modifications without interfering with you. I would like to make woocommerce fully compatible.

  9. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    @franticpsyx: I am using WC 2.2.11.

    localization of e-mails should now work again

    The problem I had, was not related to po-mo files. Did you review the woocommerce thread: https://github.com/woothemes/woocommerce/pull/7308 ?

    I am going to submit another PR to them, with filter solution, unless you give me something else.

  10. franticpsyx
    Member
    Posted 7 months ago #

    Perhaps I'm missing something, but why can't you just filter the output of the particular get_option() call you want to localize?

  11. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    @franticpsyx: because, even I filter, it still gets translated with their __(), which I do not want in some case, as described in https://github.com/woothemes/woocommerce/pull/7308. Please, continue this discussion at woocommerce thread, so that woocommerce people would be able to see it too.

  12. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    @steffen-ehrmann: did you get it working? Do you still need help?

  13. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    @franticpsyx: BTW, woocommerce was kind enough to accept my suggestion on filter instead of __(), look in their latest file woocommerce/includes/emails/class-wc-email.php:

    public function get_option( $key, $empty_value = null ) {
                    return apply_filters( 'woocommerce_email_get_option', __( parent::get_option( $key, $empty_value ) ), $this );
            }

    This means that woocommerce can now be configured to be fully compatible with qTranslate-X! I am going to publish instructions somewhere on how to do it.

  14. Steffen Ehrmann
    Member
    Posted 7 months ago #

    John, I did not get it working with your newest master.zip.

    See on this page: http://www.ehrmann-photography.de/?product=41&lang=en you should be able to change language and you will see that everything works, except '[:de]Hintergrund[:en]Background'.

    I am looking into creating a copy for you. I will also take a loot at the code, maybe I can figure it out already. Will than tell you what I got.

  15. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    Steffen, I assume you tried all the mentioned above plugins that claim to marry q- with woo-, did you?

    Yes, a test-copy of the site would help a lot. If you give me the missing in those plugins filter name, it would be great too.

  16. Steffen Ehrmann
    Member
    Posted 7 months ago #

    I did not try them yesterday night yet, now I did.

    'qTranslate support for WooCommerce' has this under known issues:

        Categories/Attributes/etc show up untranslated in the backend.

    The other two seem to mention that it works, but it does not for me. One thing I recognized was that the attribute name is being shown in uppercase, while everything else is normal on the product page. But this does not explain why I do not get the 'qtranxs-lang-switch-wrap' class in the page where I set up Attributes, in comparison to 'Delivery Times', 'Categories', 'Tags' and 'Shipping Classes'. But then, also the class 'search-form' seems to be missing on this page.

    edit: Also deactivating all plugins except woocommerce and q-translate-X does not help

  17. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    Well, Steffen, then this is a new issue. I am not sure how the other user did not hit it. So, am I waiting for test-copy or do you wish to solve it and let me know the result?

  18. John Clause
    Member
    Plugin Author

    Posted 7 months ago #

    @steffen-ehrmann: I installed new plugin "WooCommerce & qTranslate-X", which is available on GitHub only for now, https://github.com/qTranslate-Team/woocommerce-qtranslate-x, and it seems to take care of the problem. This plugin is not yet completely finished, but it might do the work for you. Please, let me know what is left not working.

Reply

You must log in to post.

About this Plugin

  • qTranslate X
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic