WordPress.org

Support

Support » Plugins and Hacks » Query Multiple Taxonomies » [Resolved] How to translate Categories and Tags in widget?

[Resolved] How to translate Categories and Tags in widget?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author scribu

    @scribu

    “Categories” and “Tags” are strings collected from the taxonomy objects.

    They can be found in the WordPress .pot file.

    That’s a strange decision to make this code like it is 🙂

    Why they have not been added to the plugins .po and .mo files?

    Now I need to change these phrases for whole WordPress, because instead of “Categories” I will write something like “Country” and instead of “Tags” I’ll write something like “Type of activity” and all these phrases will be the same everywhere else.

    Maybe you can suggest some other solution?

    Plugin Author scribu

    @scribu

    Why they have not been added to the plugins .po and .mo files?

    Because Categories, Tags and custom taxonomies are registered outside of the plugin. QMT’s job is just to use them.

    Maybe you can suggest some other solution?

    You can register new taxonomies with whatever names you want.

    Now I need to change these phrases for whole WordPress, because instead of “Categories” I will write something like “Country”

    You can change “categories” to “country” in the functions.php
    The method is not recommended as the terms may change in the core files in new versions of WordPress, but I haven’t encountered any problems.

    function notes_tagged_init() {
    global $wp_taxonomies;
    $wp_taxonomies[‘category’]->labels = (object) array(
    ‘name’ => ‘country’,
    ‘singular_name’ => ‘country’,
    ‘all_items’ => ‘All countries’,
    ‘edit_item’ => ‘Edit country’,
    ‘menu_name’ => ‘country’,
    ‘update_item’ => ‘Update country’,
    ‘add_new_item’ => ‘Add country’,
    ‘search_items’ => ‘Search countries’,
    ‘popular_items’ => ‘Popular countries’,
    ‘new_item_name’ => ‘New country’,
    ‘add_or_remove_items’ => ‘Add or remove countries’,
    ‘parent_item’ => null, ‘parent_item_colon’ => null,
    ‘choose_from_most_used’ => ‘Choose from most used country’,
    ‘separate_items_with_commas’ => ‘Separate countries with commas’,
    );
    $wp_taxonomies[‘category’]->label = ‘Country’;
    }
    add_action( ‘init’, ‘notes_tagged_init’ );

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] How to translate Categories and Tags in widget?’ is closed to new replies.
Skip to toolbar