a-roomana / django-jalali-date

Jalali Date support for user interface. Easy conversion of DateTimeFiled to JalaliDateTimeField within the admin site, views, forms and templates.
MIT License
291 stars 33 forks source link

نمایش روز به صورت فارسی #60

Open mirreza1360 opened 2 years ago

mirreza1360 commented 2 years ago

با سلام برای نمایش روز به صورت فارسی میشه راهنمایی بفرمایید؟

a-roomana commented 2 years ago

متوجه منظورتون نشدم در کدوم قسمت مشکل دارید.

mirreza1360 commented 2 years ago

در قسمت نمایش تاریخ بصورت فارسی مثلا بجای روز بصورت عددی روز رو بصورت مثلا شنبه نشون بده.تمام روشهای گفته شده رو انجام دادم ولی نشد..ورژن جنگو4 هستش..

iam-Robo commented 1 year ago

سلام منم مشکل در نمایش فارسی ماه رو دارم ، راهی پیدا کردین؟

a-roomana commented 1 year ago

hello

if you want only to show the name of a month in Jalali, you must use the strftime. you can see an example of this on the readme

if you can show the name of the month but it's not Persian, you should add this command to your settings

LANGUAGE_CODE = 'fa'

import locale
locale.setlocale(locale.LC_ALL, "fa_IR.UTF-8")
hrfahimi commented 1 year ago

اگر مشکلتون به این صورت است که مثلا «آذر» را به صورت «Azar» نشان می دهد و سیستم شما لینوکس/ابونتو است، احتمالا اشکل از نصب نبودن local مناسب باشد. برای نصب local فارسی می تونید از این روش در خط فرمان استفاده کنید:

$ locale -a $ sudo apt-get install language-pack-fa $ sudo dpkg-reconfigure locales

و بعد کد زیر رو در فایل تنظیمات پروژه قرار بدین:

LANGUAGE_CODE = 'fa-ir'

import locale

locale.setlocale(locale.LC_ALL, "fa_IR.UTF-8")