How to translate Categories and Tags in widget?
-
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/
-
“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?
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’ );
- The topic ‘How to translate Categories and Tags in widget?’ is closed to new replies.