Trouble to translate own plugin (add_menu_page/add_submenu_page)
-
Hi,
I spend few hours to fix my problem – I’m giving up. I need help!
Whats wrong with my code to translate an admin-menu? Everything else is nice translated (plugin header, error messages, buttons – perfect!), the menu doesn’t work. ??
I use PoEdit Pro for the translation.
text-domain: yet-another-blogroll
add_action('plugins_loaded', 'yab_init');
function yab_init() { load_plugin_textdomain( 'yab', false, plugin_dir_path( __FILE__ ) . 'languages/' ); }
add_action('admin_menu', 'yab_admin_menus');
function yab_admin_menus() { if ( current_user_can( 'manage_options' ) ) : // Hauptmenü $top_menu_item = 'yab_admin_page'; add_menu_page('', __( "Yet Another Blogroll", 'yet-another-blogroll' ), 'manage_options', 'yab_admin_page', 'yab_admin_page', 'dashicons-rss' ); // Untermenü: Information (wie Hauptmenü) add_submenu_page($top_menu_item, '', __( "Overview", 'yet-another-blogroll' ), 'manage_options', $top_menu_item, $top_menu_item ); // Untermenü: Gruppen add_submenu_page($top_menu_item, '', __( "Groups", 'yet-another-blogroll' ), 'manage_options', 'yab_groups_admin_page' ); // Untermenü: Webseiten add_submenu_page($top_menu_item, '', __( "Websites", 'yet-another-blogroll' ), 'manage_options', 'yab_websites_admin_page' ); // Untermenü: Einstellungen add_submenu_page($top_menu_item, '', __( "Settings", 'yet-another-blogroll' ), 'manage_options', 'yab_settings_admin_page' ); // Untermenü: Fehlerprotokoll add_submenu_page($top_menu_item, '', __( "Error logs", 'yet-another-blogroll' ), 'manage_options', 'yab_errorlogs_admin_page' ); endif; }
Please! Help! Me! It’s a detail, yes, but a pain in the… ??
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Trouble to translate own plugin (add_menu_page/add_submenu_page)’ is closed to new replies.