WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[resolved] How to translate Categories and Tags in widget? (5 posts)

  1. vicius
    Member
    Posted 1 year ago #

    Hello,
    I have successfully translated all plugin to the required language. But there are č words left not translated on the front-end:
    Categories
    Tags
    I could't even find such terms in the plugin code, how to translate them? There are no such phrases in the .po and .mo files..

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

  2. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    "Categories" and "Tags" are strings collected from the taxonomy objects.

    They can be found in the WordPress .pot file.

  3. vicius
    Member
    Posted 1 year ago #

    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?

  4. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. krinil
    Member
    Posted 1 year ago #

    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' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic