JSFiddle - React, Tailwind, and code Playground
JavaScript
var words = ["زیبا", "عالی", "قوی"],
alt_w = ["قشنگ", "خیلی خوبی", "نیرومند"];
var context = "امروز یک روز زیبا است و من احساس عالی دادم."
var res = words.reduce((acc, item, i) => {
const regex = new RegExp(item, "g");
return acc.replace(regex, alt_w[i]);
}, context);
alert(res);