## url rewriting – How to translate slugs in custom post types or making them dynamic?

Question

How can we translate the rewrite slug in custom post types? Or making them dynamic with regex?

For example:

function news_init() {
$args = array( 'labels' => array( 'name' => __('News (Pages)'), 'singular_name' => __('News'), 'all_items' => 'All News' ), 'public' => true, 'rewrite' => array( 'slug' => 'news', 'with_front' => true ), register_post_type('news',$args);
}

That 'slug' => 'news', needs to be dynamic for different translation sites. Can we do it without any plugin?