حسنًا، لقد قمت بتجميع حل ويبدو أنه يعمل. هل فعلت هذا بشكل صحيح، أم أنني أفعل أشياء فظيعة؟ ![]()
<script type="text/discourse-plugin" version="0.8">
// تعديل مسار الموضوع.
api.modifyClass('route:topic', {
beforeModel( transition ) {
var params = this.paramsFor('topic');
// الإنجليزية
if( params['id'] == 123 ) {
this.router.transitionTo('/c/tutorials/english/29'); // يلغي ضمنيًا الانتقال الجاري.
}
// الفرنسية
if( params['id'] == 456 ) {
this.router.transitionTo('/c/tutorials/french/30'); // يلغي ضمنيًا الانتقال الجاري.
}
}
});
</script>