Page MenuHomePhabricator

Creating Gujarati (Hindu) Calendar
Open, MediumPublic

Description

On Gujarati Wikipedia, I want to use Traditional Gujarati (Hindu/Indian) Calendar. This calendar is different than the translation of Gregorian calendar, it is like Chinese Traditional Calendar, or Islamic Calendar, where each date of the Gregorian calendar has its corresponding traditional date (and month, year). As the calendar is Lunisolar calendar, corresponding dates/days will change every year. For example, you can see https://gu.wikipedia.org/wiki/મુખપૃષ્ઠ/ટ્રાયલ_૨૦૧૫, where in the top box, below the wikiglobe, you will see "જૂન ૪, ૨૦૧૫" displayed today, which is derrived by using '[[{{#time: F j}}]], {{#time: Y}}' . I want "જેઠ વદ ૨, ૨૦૭૧" displayed instead of "જૂન ૪, ૨૦૧૫". I am happy to assist in inputting values for the whole year anywhere with their corresponding Gregorian dates, if needed.

Please remember that "જૂન ૪, ૨૦૧૫" (which is Gregorian) is mere translation/transliteration of "June 4, 2015", while the desired value "જેઠ વદ ૨, ૨૦૭૧" is an actual correspnding date according to the Gujarati Calendar.

Event Timeline

Dsvyas raised the priority of this task from to Needs Triage.
Dsvyas updated the task description. (Show Details)
Dsvyas added subscribers: Dsvyas, Nemo_bis.
hoo added a project: I18n.
hoo set Security to None.
hoo subscribed.
Aklapper triaged this task as Lowest priority.Jul 15 2017, 12:28 PM

No progress on this. (If there was progress, it would be listed in this task.) Your patches are welcome.

Nemo_bis raised the priority of this task from Lowest to Medium.Jul 15 2017, 3:48 PM

We of course want to support all currently used calendars, but for instance I'm unable to translate the description of this bug to a specification. https://en.wikipedia.org/wiki/Hindu_calendar is a mess as well.

If you want someone else to have a chance to code what you're asking, please describe the full process to convert a Gregorian date to your desired format, or point out an existing implementation which satisfies your needs? For instance I see http://cldr.unicode.org/development/development-process/design-proposals/chinese-calendar-support and http://www.unicode.org/reports/tr35/tr35-dates.html#monthPatterns_cyclicNameSets .

have developed full Python Code for this. It is ready with me now. That code can calculate all the five aspects of Hindu / Indian / Gujarati Panchang / Calender. I am ready to donate that code.

Hi @Aniket, thanks for your efforts! Could you please provide a link to a code repository if you'd like to share your code in public, and maybe answer Nemo's last comment and "describe the full process to convert a Gregorian date to your desired format, or point out an existing implementation which satisfies your needs"?
If the code already integrates with MediaWiki (which is mostly written in PHP), then also see https://www.mediawiki.org/wiki/Gerrit/Code_review/Getting_reviews . If it's standalone code then (apart from reviewing the code itself) another question to sort out is how that code would integrate or interact with MediaWiki code.

Hi @Aklapper, Please help me get a VPS on wmflab where I'll host the code and all related documents so that anybody can review and test the accuracy of the code.

@Aniket: Hi, please see https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS for general info on Wikimedia CloudVPS. Also note that CloudVPS is not a code hosting place (in the sense of "allow others to look at the source code itself"), hence my question if you could please provide a link to a public repo where to see the code.

I am yet to have any public code repository for this.

Have already gone through the link that you have shared about a month ago for another project on Gujarati Wikipedia. But all the documents there are too confusing for me and could not figure out how to set it up.

Asked for CloudVPS as I thought, it would be a place from where other stackholders from Gujarati Wikipedia can also Run and Test the code and other people who want to review the code can do so. (Actually suggestion to host the code there came from a few other people from Gujarati Wikipedia) and if you say that CloudVPS is not for hosting the code we wikipedians develope for wikipedia, I then wonder and fail to understand what is it good for.

Anyway, it seems we are going in a loop.

Hey @Aniket, you may want to have a look at these two links:

These two WMCS services provide a place for you to run your code in the cloud, outside of your computer. For that there are some requirements that you should read. Specifically, the code must be open source with an OSI compliant license.

If what you want to do is to host the code and have other people look at it and try it out locally, then I recommend you find a place to host the code, like Github, Gitlab, or our own Gerrit. Gerrit has a bit of a steeper curve and more requisites for opening repos, so you may want to start with one of those other services instead.

Once your code is public, and licensed with an open source license, if you want to deploy it to be run on the cloud, look at the documentation for Toolforge and CloudVPS I linked above as that can be helpful. Toolforge is probably the best place to run a python tool/script/webservice on the cloud, it should be fairly easy and the documentation is good.

Let us know if this clears it out and if you need any more help.

@Aniket: Hi, did the last comment help, or are you stuck at some step? Is there a public place where to take a look at your code?

@Aklapper , thanks for asking but that question is already answered above. I do not have any public repository yet.

Was asked to come up with detailed documentation so that my code can be reviewed, therefore I am in the process of preparing that. Also, publishing the code on pubic repositories would require lots of other formalities to be done.

Hello @Aklapper & @Jhernandez,

May I suggest another way to clear this hard road-block that we have hit?

Indian Hindu Calendar is in fact very simple to calculate even using Wiki's mathematical functions already available on Gujarati Wikipedia, provided following ingredients are made available to us.

  1. Sunrise & Sunset time for any given date and given geographic location in local time.
  2. Moon rise & Moon Set date time for any given date and given geographic location in local time.
  3. The Sun's and the Moon's Right ascension (see: https://en.wikipedia.org/wiki/Right_ascension) expressed in decimal degrees at given point of time for the given location
  4. Right ascension for the star Spica (https://en.wikipedia.org/wiki/Spica), and Alpha_Cancri (https://en.wikipedia.org/wiki/Alpha_Cancri) expressed in decimal degrees
  5. value of Right ascension for any given time for any location that is rising in east at that time
  6. Previous "No Moon", and Next "No Moon" date & time for a given datetime and given location. (Please note: "No Moon" is NOT same as "New Moon". No moon is when the Moon and the Sun are actually in conjunction ( More info: https://en.wikipedia.org/wiki/Conjunction_(astronomy) ) , along with previous full moon and next full moon's date & time with refence to given date & time. In other words, it should be date & time when the difference between RA of the Moon and RA of the Sun is 0 Arc degrees.
  7. Date & Time Arithmetic

In addition, if we may get some ability to convert Decimal Degree to Arc Degree, Minues, Seconds and vice versa, that would be added advantage.

If we get values of just those 9 fundamental ingredients that are most essential for the calculation of the calendar, rest is based on simple mathematics and I'll do that on Gujarati Wiki myself using Wikimarkup.

In fact some five years ago on Gujarati Wiki , I have already implemented a tiny portion of Hindu Calendar using Wiki markup and if above ingredients functionality is made available, I should be able to come up with entire Panchang using Wikimarkup mathematical functions only.

Please do let us know if we can take this route.

@Aniket: I am not aware of a hard road-block that we have hit. Please elaborate.

In general, it would be helpful if you could elaborate how exactly you have implemented your solution and how exactly the solution interacts with MediaWiki, both with sufficient technical details. Currently we know nothing, so it is hard to provide recommendations and help.

@Aklapper, instead, how about investing all our time discussing whether it is possible to come up with suggested solution?

After your edit to your latest post, I need to add this here that I have already mentioned above that my solution is in Python.

As dictated to me earlier in this thread itself, it requires lots of processing (Elaborate documentation + publishing it somewhere). That is a very long process for me as I need to work on "paying projects" too to continue feeding my family. Hence, let us forget that route as of now.

Therefore, if you can figure out whether it is possible to provide with functionality we require to implement, it would be worthwhile.

Pasting below for your ready reference the points I mentioned:-

  1. Sunrise & Sunset time for any given date and given geographic location in local time.
  2. Moon rise & Moon Set date time for any given date and given geographic location in local time.
  3. The Sun's and the Moon's Right ascension (see: https://en.wikipedia.org/wiki/Right_ascension) expressed in decimal degrees at given point of time for the given location
  4. Right ascension for the star Spica (https://en.wikipedia.org/wiki/Spica), and Alpha_Cancri (https://en.wikipedia.org/wiki/Alpha_Cancri) expressed in decimal degrees
  5. value of Right ascension for any given time for any location that is rising in east at that time
  6. Previous "No Moon", and Next "No Moon" date & time for a given datetime and given location. (Please note: "No Moon" is NOT same as "New Moon". No moon is when the Moon and the Sun are actually in conjunction ( More info: https://en.wikipedia.org/wiki/Conjunction_(astronomy) ) , along with previous full moon and next full moon's date & time with refence to given date & time. In other words, it should be date & time when the difference between RA of the Moon and RA of the Sun is 0 Arc degrees.
  7. Date & Time Arithmetic

@Aniket: I don't think that all these things exist and I'm unsure what would be the best way to implement them. Could you bring this up on the mailing list at https://lists.wikimedia.org/mailman/listinfo/wikitech-l with sufficient context, and ask the broader developer community for feedback and recommendations?

@Aklapper, At least item number 1 & 7 exists at PHP level, if that can be exposed at Wiki language, we do not have to worry about those two points to start with.

For example, people on Guj. Wiki. can get a template like :

{{Sunrise | place=London | date=2020-10-07}}
{{Sunset | place=London | date=2020-10-07}}

and it generates Sunrise & Sunset time for London in London's timezone for that date at the place of template.

For item no 2, 3, 4, 5, & 6 one need to rely on third party open source libraries (they are available.)

Thank you for your link and suggestion for WikiTech, but I humbly believe WMF side should take this further, as I myself do not have enough time and energy for starting this discussion all over again at yet another place.

For items 2, 3, 5, & 6, could you please share the names of third-party open source libraries that you are aware of?

@Aklapper, I am aware of a library for Python not for PHP.

The one that I have used in my code is PyEphem. (https://github.com/brandon-rhodes/pyephem).