Same name category in different languages? WPML adds `@`

I use WPML to translate my WordPress theme.
Two categories have the same name in Italian and English.
So, WPML(WordPress) adds @ and the language code after the name of the second language’s category.
This because WordPress doesn’t want that there’s 2 categories with the same name.

Example:

Read More

Category Language 1 (italian): Bar

Category Language 2 (english): Bar @en.

How can I delete this @en?

I found this link http://wpml.org/forums/topic/same-name-for-categories-in-different-languages/
but it don’t give me some help.

Have I to change the PHP?

Can you help me please? 🙂

Thank u

Related posts

Leave a Reply

1 comment

  1. Yes, you have to change your PHP. If you see that “@en” string in term names that means WPML filters are not filtering your code, probably because the function used to get the terms is not in WPML’s list of filtered functions.

    So, the easiest way to filter them is to use str_replace() before generate the output.

    In example, if you are using wp_get_post_terms() to get a list of the terms for a particular post:

    $terms = wp_get_post_terms( $post->ID, 'your_taxonomy' );
    foreach ( $terms as $t ) {
      echo str_replace('@'.ICL_LANGUAGE_CODE, '', $t->name);
    }