在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):usablica/persian.js开源软件地址(OpenSource Url):https://github.com/usablica/persian.js开源编程语言(OpenSource Language):JavaScript 99.7%开源软件介绍(OpenSource Introduction):persian.jsA simple JavaScript library for Persian language localization. How to useSimply include In Node.jsnpm install persianjs In Bowerbower install persianjs Functions1) Convert to Persian charactersUsed for converting Arabic characters to Persian. Example: persianJs("علي").arabicChar().toString(); //returns: علی 2) Convert to English numbers from Persian NumberUsed for converting Persian numbers to English. Example: persianJs("۳۴۵").persianNumber().toString(); //returns: 345 3) Convert to Persian numbers from Arabic NumberUsed for converting Arabic numbers to Persian. Example: persianJs("٣٤٥").arabicNumber().toString(); //returns: ۳۴۵ 4) Convert to Persian numbers from English NumberUsed for converting English numbers to Persian. Example: persianJs("345").englishNumber().toString(); //returns: ۳۴۵ 5) Convert to English numbers from Arabic NumberUsed for converting Arabic and Persian numbers to English. Example: persianJs("٣٤٥").toEnglishNumber().toString(); //returns: 345 6) Decode Percent-encoding Characters in URLsUsed to convert unreadable Persian characters in URL to readable characters. Example: persianJs("https://fa.wikipedia.org/wiki/%D8%B5%D9%81%D8%AD%D9%87%D9%94_%D8%A7%D8%B5%D9%84%DB%8C").fixURL().toString(); //returns https://fa.wikipedia.org/wiki/صفحهٔ_اصلی 7) Change keyboard layoutUsed for converting Persian char to English char. Example: persianJs("لخخلمث").switchKey().toString(); //returns: google 8) Convert numbers to wordsUsed for representing numbers as Persian words. Example: persianJs("1372").digitsToWords().toString(); //returns: یک هزار و سیصد و هفتاد و دو 9) Zero-width non-joiner correctionExample: persianJs("آمده ای ولی من رفته ام و می آییم").halfSpace().toString(); //returns: آمدهای ولی من رفتهام و میآییم Chainable usingYou can use all of the functions together with one PersianJs instance (in v0.3). Example: persianJs("علي٤2465").arabicChar().englishNumber().arabicNumber().toString(); //returns: علی۴۲۴۶۵ Roadmap
ContributingThis is a open-source project. Fork the project, complete the code and send pull request. Getting support
License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论