WPML language switcher for custom rewrite rules

A more simple solution for generating the rewrite rules would be to temporarily disable the WPML plugin. I did this using WP-CLI as follows:

wp plugin deactivate sitepress-multilingual-cms
wp rewrite flush
wp plugin activate sitepress-multilingual-cms

Note that this only works a single time. Each time you add/modify a category, the rewrite list is flushed and only the current language categories show up there. So this is only a solution when your categories do not change, or not often.