• Resolved devmania

    (@devmania)


    Hi,

    Is there a way to translate Job categories?

    I am using PolyLang, job types and job ads (listings) are translatable, but job categories aren’t.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mikey (a11n)

    (@mikeyarce)

    Hi @devmania,

    Is there a way to translate Job categories?

    Great question! I tested WPJM with Polylang and it doesn’t look like Polylang supports our custom category. Do you know if we need to do something to allow it to support our category, or does Polylang need to add something to their plugin to support our categories?

    Thread Starter devmania

    (@devmania)

    Hi, generally speaking, Polylang does support added custom post types and taxonomies like job listings and job types, but for categories, I don’t know why they are not supported, probably they are declared/added in a special way that makes them incompatible with Polylang.

    Is there a filter hook related to categories that can be used to translate caetgories within functions.php at specific moments for example when rendering the categroies in the <select> items.
    I can create a lookup array to translate them before rendering.

    Plugin Author Mikey (a11n)

    (@mikeyarce)

    Hi @devmania,

    There is a filter in Polylang to do this, here’s how it works:

    add_filter( 'pll_get_taxonomies', 'add_tax_to_pll', 10, 2 );
     
    function add_tax_to_pll( $taxonomies, $is_settings ) {
        if ( $is_settings ) {
            unset( $taxonomies['job_listing_category'] );
        } else {
            $taxonomies['job_listing_category'] = 'job_listing_category';
        }
        return $taxonomies;
    }

    Cheers,

    Plugin Author Mikey (a11n)

    (@mikeyarce)

    Just a note that I’m going to add this to WP Job Manager as well, it will likely be in the next release! ??

    Thread Starter devmania

    (@devmania)

    Thanks.
    It worked in functions.php.

    • This reply was modified 1 year ago by devmania.
    • This reply was modified 1 year ago by devmania.
    Plugin Support Jay

    (@bluejay77)

    Thanks for letting us know, @devmania!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to translate Job categories?’ is closed to new replies.