You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.3 KiB
54 lines
2.3 KiB
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const localesDir = path.join(__dirname, "..", "src", "translations", "locales");
|
|
const files = fs.readdirSync(localesDir).filter((f) => f.endsWith(".json"));
|
|
|
|
const newTranslations = {
|
|
fa: {
|
|
subscriptionNoActiveTitle: "فاقد اشتراک فعال",
|
|
subscriptionNoActiveDesc:
|
|
"شما در حال حاضر اشتراک فعالی ندارید. فعالسازی اشتراک تنها زمانی امکانپذیر است که اولین کیس به شما معرفی شود.",
|
|
subscriptionStatusTitle: "وضعیت اشتراک",
|
|
subscriptionStatusDesc: "{days} روز از اعتبار اشتراک شما باقی مانده است.",
|
|
subscriptionRenewButton: "تمدید اشتراک",
|
|
subscriptionRenewPending: "در حال تمدید...",
|
|
},
|
|
ar: {
|
|
subscriptionNoActiveTitle: "لا يوجد اشتراك نشط",
|
|
subscriptionNoActiveDesc:
|
|
"ليس لديك اشتراك نشط حاليًا. تفعيل الاشتراك ممكن فقط عند تقديم أول مرشح لك.",
|
|
subscriptionStatusTitle: "حالة الاشتراك",
|
|
subscriptionStatusDesc: "متبقي {days} يوم من صلاحية اشتراكك.",
|
|
subscriptionRenewButton: "تجديد الاشتراك",
|
|
subscriptionRenewPending: "جاري التجديد...",
|
|
},
|
|
default: {
|
|
subscriptionNoActiveTitle: "No Active Subscription",
|
|
subscriptionNoActiveDesc:
|
|
"You currently do not have an active subscription. Activation of subscription is only possible when your first case is introduced to you.",
|
|
subscriptionStatusTitle: "Subscription Status",
|
|
subscriptionStatusDesc: "{days} days remaining of your subscription.",
|
|
subscriptionRenewButton: "Renew Subscription",
|
|
subscriptionRenewPending: "Renewing...",
|
|
},
|
|
};
|
|
|
|
files.forEach((file) => {
|
|
const filePath = path.join(localesDir, file);
|
|
const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
|
|
if (!data.common) {
|
|
data.common = {};
|
|
}
|
|
|
|
const lang = file.replace(".json", "");
|
|
const translations = newTranslations[lang] || newTranslations.default;
|
|
|
|
Object.keys(translations).forEach((key) => {
|
|
data.common[key] = translations[key];
|
|
});
|
|
|
|
fs.writeFileSync(filePath, JSON.stringify(data, null, 2), "utf8");
|
|
console.log(`Updated ${file}`);
|
|
});
|