• Resolved felipedesign

    (@felipedesign)


    I am using Weglot to translate my page from German to English and it works fine. Only on the “address” page in the account section, some address labels are not translated, because the whole block is in <address>-tags, which are ignored by Weglot to not translate the customers address.

    Can anybody tell me how to get the address labels out of the <address>-tags?

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Remy here from Weglot. Indeed, Weglot purposely doesn’t translate Address as it’s important to keep them as in the original version. Why do you want to translate address?

    Thread Starter felipedesign

    (@felipedesign)

    I don’t want to translate the address, but the address field names, see here:
    https://www.dropbox.com/s/pb2vncjwz8ae8b9/weglot-translate.png?dl=0

    I see, in that case you will need to use the filter weglot_exclude_blocks

    This filter takes in parameter the array of default excluded block in which you can find “address”

    You can use this filter to remove it

    Thread Starter felipedesign

    (@felipedesign)

    Hi Remi.

    I’m not sure if you didn’t get me right or the other way round 🙂

    I have some words that are NOT translated from German to English currently but I want them to be translated. How do I use the filter then?

    Yes, I got you 🙂

    The problem is that Weglot by default adds the block “address” to the list of things to exclude. That is why this is by default NOT translated

    So you need to remove the “address” from the list of excluded element of Weglot. Then it will be translated. And for this you need to use the filter:
    https://developers.weglot.com/wordpress/filters/other-filters#hook-weglot_exclude_blocks

    In the example, it does nothing but you can replace //Code by your own code to “address” from the array $exclude_blocks

    Best

    Thread Starter felipedesign

    (@felipedesign)

    Hi Remy,

    sorry, I’m not a pro in this.

    1. Do I paste this code in the weglot.php file?
    2. What exactly do I write instead of //Code?

    Thanks a lot!

    Hi, Don’t hesitate to read documentation of WordPress on filters
    Also, you can ask the help of your developer.

    But yes, filters are put in the functions.php of your theme.
    The code you need to enter is simply to retrieve the array, then remove one element from it (address) and return the array without this element

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Translation problems in account address page’ is closed to new replies.