Title: API &#8211; Translation for CPT
Last modified: January 29, 2024

---

# API – Translation for CPT

 *  Resolved [blgleadoff](https://wordpress.org/support/users/blgleadoff/)
 * (@blgleadoff)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/api-translation-for-cpt/)
 * Hello,
 * I have created a Custom Post Type “faq” in my function.php, I can translate it,
   but when I go to the [https://www.myafterme.com/en/wp-json/wp/v2/faq/91](https://www.myafterme.com/en/wp-json/wp/v2/faq/91)
   I cannot get the translation. Do I miss something ? I cannot find any anwser 
   to my question.
 *     ```wp-block-code
        $labels = array(
               'name'               => 'Foire aux questions',
               'singular_name'      => 'Question fréquente',
               'menu_name'          => 'FAQ',
               'name_admin_bar'     => 'Question fréquente',
               'add_new'            => 'Ajouter',
               'add_new_item'       => 'Ajouter une nouvelle question fréquente',
               'new_item'           => 'Nouvelle question fréquente',
               'edit_item'          => 'Éditer la question fréquente',
               'view_item'          => 'Voir la question fréquente',
               'all_items'          => 'Toutes les questions fréquentes',
               'search_items'       => 'Rechercher des questions fréquentes',
               'parent_item_colon'  => 'Question fréquente parente :',
               'not_found'          => 'Aucune question fréquente trouvée.',
               'not_found_in_trash' => 'Aucune question fréquente trouvée dans la corbeille.'
           );
   
           $args = array(
               'labels'             => $labels,
               'public'             => true,
               'publicly_queryable' => true,
               'show_ui'            => true,
               'show_in_menu'       => true,
               'show_in_rest'       => true,
               'query_var'          => false,
               'capability_type'    => 'post',
               'has_archive'        => false,
               'hierarchical'       => false,
               'menu_position'      => null,
               'rewrite'            => array('slug' => 'faq'),
               'supports'           => array('title', 'thumbnail','editor'),
               'menu_icon'          => 'dashicons-testimonial',
           );
   
           register_post_type('faq', $args);
       ```
   
 * Best regards
    -  This topic was modified 2 years, 8 months ago by [blgleadoff](https://wordpress.org/support/users/blgleadoff/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fapi-translation-for-cpt%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Alex](https://wordpress.org/support/users/alexcozmoslabs/)
 * (@alexcozmoslabs)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/api-translation-for-cpt/#post-17387771)
 * Hi,
 * Did you use the latest version of our plugin?
   The rest-api is processed through
   the translation engine in TranslatePress. So you can access it at _/de/wp-json/
   wp/v2/posts?197/,_ for example, where _197 _is the id of the post.Basically, 
   every REST endpoint is processed when accessed via the language prefix.
 *  Thread Starter [blgleadoff](https://wordpress.org/support/users/blgleadoff/)
 * (@blgleadoff)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/api-translation-for-cpt/#post-17387833)
 * Hi,
 * Yes, I’m on the 2.7.0, the latest I can see.
 * Sorry, have you seen the link [https://www.myafterme.com/en/wp-json/wp/v2/faq/91](https://www.myafterme.com/en/wp-json/wp/v2/faq/91)?
 * This is a real project, and I already did the translation in the back office.
 * We can see, that the slug has changed but not the rest. This is a Custom Post
   Type, do I need to do something or do I have any issue on capabilities or something
   else ?
 * Best regards,
 *  Thread Starter [blgleadoff](https://wordpress.org/support/users/blgleadoff/)
 * (@blgleadoff)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/api-translation-for-cpt/#post-17392970)
 * Hello,
 * Since I had no anwser from you, I search for a few hours and I found were was
   the issue, when you register the post type, make sure to put a priority on the
   add_action(‘init’, ‘register_faq_post_type’, 1);
 * In this case, you will see the translation in the API.
 * Is it the right way to do it ?
 *  Plugin Support [Alex](https://wordpress.org/support/users/alexcozmoslabs/)
 * (@alexcozmoslabs)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/api-translation-for-cpt/#post-17394657)
 * Hi,
   I will bring more details on this topic next week.Thank you for understanding.

Viewing 4 replies - 1 through 4 (of 4 total)

 The topic ‘API – Translation for CPT’ is closed to new replies.

 * ![](https://ps.w.org/translatepress-multilingual/assets/icon.svg?rev=3166541)
 * [TranslatePress - Translate Multilingual sites with AI Translation](https://wordpress.org/plugins/translatepress-multilingual/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/translatepress-multilingual/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/translatepress-multilingual/)
 * [Active Topics](https://wordpress.org/support/plugin/translatepress-multilingual/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/translatepress-multilingual/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/translatepress-multilingual/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Alex](https://wordpress.org/support/users/alexcozmoslabs/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/api-translation-for-cpt/#post-17394657)
 * Status: resolved