Module:Date2en: Difference between revisions
m ۱ نسخه واردشده |
m 2 revisions imported |
||
(No difference)
| |||
Latest revision as of 12:53, November 30, 2025
local p = {}
local numConv = require( "Module:Numeral converter" ).convert
-- Use this function from templates. function p.convert_template(frame)
return p.convert(frame.args[1])
end
-- Use this function directly in modules. function p.convert(text) text = mw.ustring.gsub(text, "ٔ", "") text = mw.ustring.gsub(text, "ژانویه", "January") text = mw.ustring.gsub(text, "فوریه", "February") text = mw.ustring.gsub(text, "مارس", "March") text = mw.ustring.gsub(text, "آوریل", "April") text = mw.ustring.gsub(text, "مه", "May") text = mw.ustring.gsub(text, "ژوئن", "June") text = mw.ustring.gsub(text, "ژوئیه", "July") text = mw.ustring.gsub(text, "اوت", "August") text = mw.ustring.gsub(text, "سپتامبر", "September") text = mw.ustring.gsub(text, "اکتبر", "October") text = mw.ustring.gsub(text, "نوامبر", "November") text = mw.ustring.gsub(text, "دسامبر", "December") text = mw.ustring.gsub(text, "ساعت", "hours") text = mw.ustring.gsub(text, "روز", "days") text = mw.ustring.gsub(text, "هفته", "weeks") text = mw.ustring.gsub(text, "ماه", "months") text = mw.ustring.gsub(text, "سال", "years")
return numConv("en", text) end
return p