Closed PalasOnGithub closed 1 year ago
After 2w I haven't gotten any messages or respond from the developers , I'll close the issue But issues is still out there </3 !
Hi @PalasOnGithub! Sorry for the late response
It does work for me on Linux
Python 3.11.6 (main, Oct 12 2023, 10:04:56) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jdatetime
>>> jdatetime.set_locale('fa') or jdatetime.set_locale('fa_IR')
'fa'
>>> date_text = jdatetime.datetime.now()
>>> print(date_text.strftime('%a'))
جمعه
I don't have windows to test it, I'm open for a PR to fix the issue on windows!
On Windows you should use jdatetime.set_locale('Persian_Iran')
instead of jdatetime.set_locale('fa_IR')
.
Thanks @5j9!
BTW, @5j9 probably it worth creating a PR and updating the doc about how use it in windows
if you have time
Thanks to @slashmili and @5j9 my problem got solved! but its better to make a note about it in readme file of proj in github and pypi duc.
I can make a pull request to improve the docs, but I doubt that 'Persian_Iran'
is the best choice here. On my Windows 10 machine the 'fa_IR'
locale works just fine if we replace the condition at line 61 with a simple FA_LOCALE = 'fa_IR'
for all platforms. One should note that there is a difference between fa_IR
and Persian_Iran
locales on Windows. The first one uses UTF-8
encoding while the second one uses Windows-1256
and I believe most users would prefer UTF-8. I'm just not sure if all Windows versions support the fa_IR
, or why Persian_Iran
has been chosen in the first place.
Hi there , I want to get the time as Persian Unicode, but when I set locale to 'fa_IR' , I get the same result in English
Here's The code :