url rewriting – Bilingual WP site: How to achieve different URL sturcture rule based on its language?

A wordpress website with bilingual setup, with three languages:

  • English (“primary language”) : “en”
  • Traditional Chinese : “zh-hant”
  • Simplified Chinese : “zh-hans”

The bilingual setup is currently achieved with the polylang plugin.

I would like to have different URL structure based on the post’s language.

For English,

example.com/blog/%category%/%post_title%

But for non-English blog post URL, I would like to use post id instead of post_title:

example.com/blog/zh-hant/%category%/%post_id%