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

Modern persian support #101

Closed
siavashkavousi opened this issue Aug 5, 2017 · 14 comments
Closed

Modern persian support #101

siavashkavousi opened this issue Aug 5, 2017 · 14 comments

Comments

@siavashkavousi
Copy link

Hi,

There is a typo here
امرداد -> مرداد
امر -> مرد

Thanks.

@alitaheri
Copy link
Member

See: #12, #39 and #16. The correct word is the one used by this library. But correctness is only relative. If enough people agree with convention over correctness. I'll change the code.

My opinion: convention is much more important because we use language to convey meaning. And language is not what's in the dictionaries and old scripts. It's what's spoken by people. I strongly agree with this change. The original author doesn't.

I think this should be a community decision.

We'll give it some time before we decide. 👍 If you agree and 👎 If you disagree With the following changes:

امرداد -> مرداد

Mordaad <- Amordaad

امر -> مرد

Mor <- Amo

آدینه -> جمعه

آ -> ج

cc @behrang @pajooh @UKbed990 @mehrdaad @amiraliakbari @MehdyKarimpour @miladkdz
@hramezani @arastu @mvalipour

@behrang
Copy link
Member

behrang commented Aug 6, 2017

We don't change our writing, although we might change speaking and reading. Here are some more examples:
خواهر
خواندن
خواستن - که با خاستن معنای متفاوتی دارد
گذار و گزار که معنای متفاوتی دارند

@siavashkavousi
Copy link
Author

I didn't know that and maybe I use it in my future applications, But there are situations that I'm not the one who makes decisions or customers disagree with it or you have to use what is common.

In my opinion you can provide a way to change these things and keep these defaults.

@alitaheri
Copy link
Member

I've never seen امرداد or آدینه being used in our everyday calendars or in any website. I understand that these are correct but unfortunately they aren't convenient. And most of us are building software for the common folk, not for The Ministry of Culture and Higher Education. I'm afraid a huge portion of our population doesn't know about this. And the ones that know will also understand مرداد. In other words, مرداد will be understood by every Iranian whereas, امرداد will only be understood by a very few.

Productivity > Perfectionism

I say it again, I won't do a thing unless I see more 👍s than 👎 s

@mvalipour
Copy link
Contributor

It was a close call for me, but I went 👎 on it. Because at the end of the day, there must be a source of truth for this and it sounds like it has to be the original form.

However I DO also feel the need on the consumers side. They are building a product for which they need to be able to design whatever language is best suitable.

Plus bear in mind, Iran is not the only country in which Jalaali calendar is used in, so can't just say one is more correct than the other one just because it's the acceptable language in Iran.

From this point on, IMO this would be the discussion of supporting dialects.

💡 Idea: why not let people extend on that?

// something like
jMoment.loadPersian({ useModernDialect: true })

or alternatively leaving some sort of extension point in there and make it possible for someone to build moment-jalaali-blahblah?

Final thought: Just like any other language/framework, I think there should be a defined set of standards for this to avoid confusion. Maybe some sort of blueprint in jalaali/blueprint?

@alitaheri
Copy link
Member

@mvalipour I like the idea of having different dialects for different cases.

jMoment.loadPersian({ dialect: '...' });

Where dialect can be: 'persian' | 'modern-persian' | 'afghan' | 'azeri' | 'pashto' | 'kurdish'

It will default to 'persian' for backward-compatibility ( what it is right now )

'modern-persian' will use the conventions. And the other dialects will cover other countries and accents that have Jalaali calendar system.

ref: https://fa.wikipedia.org/wiki/گاه‌شماری_هجری_خورشیدی

@behrang How is that?

@behrang
Copy link
Member

behrang commented Aug 6, 2017

It's OK for persian and modern-persian, but I'm not sure about afghan, azari, pashto and kurdish. I'm sure month names are different, but I'm not sure about calendar calculations.

In Jalaali and the algorithm behind it, 12PM of Tehran is important. I'm not sure afghan, kurdish and others follow it or not.

Also, I think persian-modern is better than modern-persian.

@alitaheri
Copy link
Member

@behrang I didn't know about that 😅 😅 Let's just stick to what we know. I'll add persian and persian-modern for now. Should others need other dialects, let them investigate and implement it themselves.

@mvalipour
Copy link
Contributor

mvalipour commented Aug 6, 2017

I would say add dialect/*.js files and dynamically load the dialect settings in loadPersian method and merge with the default options.

That would make it super easy to extend in the future.

@alitaheri
Copy link
Member

@mvalipour A switch case will do the job. dynamic imports aren't very bundler-friendly 😅

@mehdipourfar
Copy link

وقتی یه نفر از شما میپرسه توی چه ماهی هستیم هیچوقت نمیگین امرداد. بذارین کنار این آریایی بازی ها رو توی جامعه اوپن سورس. کاری کنین کتابخونه تون قابل استفاده باشه.

@mrmashal
Copy link

I wonder why you haven't yet implemented the "dialect" thing or even better, an extensibility point for custom strings to be used in date-formatting functions. I think there's no need to wait for the votes!

@alitaheri
Copy link
Member

@mrmashal The decision is made. But I don't have a lot of free time to implement it. I'll do it when I get the chance. PRs are welcome if this is a priority for you 👍

@alitaheri
Copy link
Member

Fixed by #104

I'll publish as soon as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants