I've got the following code in a theme to register two menus:

register_nav_menus( array(
  'primary'   => esc_html__( 'Primary', 'text-domain' ),
  'secondary' => esc_html__( 'Secondary', 'text-domain' )
) );

There is a French translation that is working for ALL other text in the theme except for these two strings. The English "Primary" and "Secondary" are still displayed in the Menus page instead.

Has anyone experienced anything like this? I've tried changing the menu IDs and names, but for some reason it still won't translate.

  • 2
    text-domain is real text domain or dummy? – obiPlabon Mar 15 '18 at 19:04
  • Ensure that the current language has been set and text domain loaded BEFORE register_nav_menus is called. Common mistake is to hook in too early. – Tim Apr 27 '18 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.