Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERPNext Arabic Numbers #19152

Open
MohammedEL-Laithy opened this issue Oct 8, 2017 · 7 comments
Open

ERPNext Arabic Numbers #19152

MohammedEL-Laithy opened this issue Oct 8, 2017 · 7 comments

Comments

@MohammedEL-Laithy
Copy link

MohammedEL-Laithy commented Oct 8, 2017

Dears,

Any language in ERPNext appears number like this 1234 but I need to appear number like ١٢٣٤ when system language became Arabic.
You can but it as CheckBok inside user setting when Language became AR.
Waiting the response :)

@achillesrasquinha
Copy link
Contributor

achillesrasquinha commented Oct 8, 2017

Check this link on how you can add translations. For ERPNext, check here. We're open for contribution.

Cheers.

@mhbu50
Copy link
Contributor

mhbu50 commented Oct 9, 2017

Download BBaran font from https://github.com/intuxicated/css-persian/tree/master/fonts
Add font files in frappe-bench/apps/frappe/frappe/public/css
Add this class in desk.css:
@font-face {
font-family: "B Baran";
src: url("BBaran.eot?") format("eot"), url("BBaran.woff") format("woff"),
url("BBaran.ttf") format("truetype"), url("BBaran.svg#BBaran") format("svg");
font-weight: normal;
font-style: normal;
}
Add this in frappe-bench/apps/frappe/frappe/public/js/frappe/desk.js
set_rtl: function () {
if (["ar", "he", "fa"].indexOf(frappe.boot.lang) >= 0) {
var ls = document.createElement('link');
ls.rel="stylesheet";
ls.href= "assets/css/frappe-rtl.css";
document.getElementsByTagName('head')[0].appendChild(ls);
$('body').addClass('frappe-rtl')
$("*").css('fontFamily', "B Baran");
}
}

@MohammedEL-Laithy
Copy link
Author

Thank you Mohammed :)
I will try this solutions soon and feed you back.

@MohammedEL-Laithy
Copy link
Author

@achillesrasquinha I tried to translate numbers like you said but it doesn't work

@MohammedEL-Laithy
Copy link
Author

MohammedEL-Laithy commented Nov 6, 2017

@mhbu50 I added the font file and did what you said but number still the same
Do you have another solution.

@clarkejj
Copy link
Contributor

clarkejj commented May 4, 2018

@abdulghani-maystroo
Copy link

abdulghani-maystroo commented Oct 24, 2022

edit locale-all.js file which located in /bench-directory/sites/assets/frappe/js/lib/fullcalendar/locale-all.js
you should just change :
(0,function(e){var a={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},t={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"}

To :

function(e,a,t){!function(e,a){a(t(0))}(0,function(e){var a={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},t={"1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","0":"0"}

Good luck 😊

@deepeshgarg007 deepeshgarg007 transferred this issue from frappe/erpnext Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants