Skip to content

Commit

Permalink
Merge pull request #73 from Liturgical-Calendar/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
JohnRDOrazio authored Dec 26, 2021
2 parents 15fb8b7 + af4de69 commit 3e02918
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 139 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
LiturgicalCalendar.iml
.idea
LitCalConfig.php
engineCache/*
nations/*
6 changes: 5 additions & 1 deletion DateOfEaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
ini_set('date.timezone', 'Europe/Vatican');

include_once( 'includes/enums/LitLocale.php' );
$LOCALE = isset($_GET["locale"]) && LitLocale::isValid(strtoupper($_GET["locale"])) ? strtoupper($_GET["locale"]) : LitLocale::LATIN;
$AvailableLocales = array_filter(ResourceBundle::getLocales(''), function ($value) {
return strpos($value, '_') === false;
});

$LOCALE = isset($_GET["locale"]) && in_array( strtolower($_GET["locale"]), $AvailableLocales) ? strtoupper($_GET["locale"]) : LitLocale::LATIN;

if(file_exists('engineCache/easter/' . $LOCALE . '.json') ){
header('Content-Type: application/json');
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ Together with the information that follows, Swaggerhub documentation of the API

A sample request to the endpoint could look like this:

https://litcal.johnromanodorazio.com/api/dev/LitCalEngine.php?year=2020&epiphany=SUNDAY_JAN2_JAN8&ascension=SUNDAY&corpuschristi=SUNDAY&returntype=JSON&locale=EN
https://litcal.johnromanodorazio.com/api/v3/LitCalEngine.php?year=2020&epiphany=SUNDAY_JAN2_JAN8&ascension=SUNDAY&corpuschristi=SUNDAY&returntype=JSON&locale=EN

If no parameters are given, the default values indicated above will be used.

Both **POST** and **GET** requests can be made.
Both **POST** and **GET** requests can be made. In the case of **POST** requests, the request body can have a content type that is either JSON encoded (`application/json` or FORM encoded (`application/x-www-form-urlencoded`). FORM encoding is the default for jQuery AJAX requests and for cURL requests, in any case a JSON encoded request body will also work.

## Using the endpoint as a calendar URL for Calendar Apps
* **GOOGLE CALENDAR ON A DESKTOP COMPUTER**: you can only *add a calendar by URL* using Google Calendar on a computer, I don't believe it is possible from smartphone / Android devices. At the bottom left corner of the screen, next to **`Other calendars`**, click on the **`+`** to add a new calendar and choose **`From URL`**. Paste in the URL of the endpoint with the desired parameters, (make sure you use **`ICS`** as value of the *`returntype`* parameter). And remember, if you omit the *`year`* parameter, it will use the current year. This should mean that as Google Calendar continues to poll the calendar URL (supposedly every 8 hours), on the turn of a new year new events should be created automatically for the new year. Once the calendar has been added from a computer, it should become available for the same gmail account on the Google Calendar app on a smartphone.
Expand Down Expand Up @@ -176,7 +176,7 @@ Two object keys are returned:

# CHANGELOG

## [v3.0](https://github.com/JohnRDOrazio/LiturgicalCalendar/releases/tag/v3.0) (December 20th 2021)
## [v3.0](https://github.com/JohnRDOrazio/LiturgicalCalendar/releases/tag/v3.0) (December 26th 2021)
* all calendar data moved from a MySQL database to JSON files, that can be tracked in the repository
* the Calendar data for the Universal Calendar, as contained in the JSON files, is now translatable to other languages through a Weblate project
* the frontend and any implementations of the API have been moved to their own separate repositories,
Expand Down
28 changes: 14 additions & 14 deletions i18n/de/LC_MESSAGES/litcal.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-19 01:58+0000\n"
"POT-Creation-Date: 2021-12-26 00:07+0000\n"
"PO-Revision-Date: 2021-12-14 00:21+0100\n"
"Last-Translator: Ubuntu <[email protected]>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -58,7 +58,7 @@ msgstr ""
#: includes/LitCalAPI.php:1361 includes/LitCalAPI.php:1385
#: includes/LitCalAPI.php:1402 includes/LitCalAPI.php:1422
#: includes/LitCalAPI.php:1444 includes/LitCalAPI.php:1458
#: includes/LitCalAPI.php:1472 includes/FestivityCollection.php:385
#: includes/LitCalAPI.php:1472 includes/FestivityCollection.php:386
msgid "Decree of the Congregation for Divine Worship"
msgstr ""

Expand Down Expand Up @@ -269,7 +269,7 @@ msgstr ""
msgid "Vigil Mass"
msgstr ""

#: includes/FestivityCollection.php:338 includes/FestivityCollection.php:365
#: includes/FestivityCollection.php:339 includes/FestivityCollection.php:366
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. "
Expand All @@ -278,7 +278,7 @@ msgid ""
"Vespers I."
msgstr ""

#: includes/FestivityCollection.php:351 includes/FestivityCollection.php:409
#: includes/FestivityCollection.php:352 includes/FestivityCollection.php:410
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. "
Expand All @@ -287,15 +287,15 @@ msgid ""
"evening Mass."
msgstr ""

#: includes/FestivityCollection.php:379
#: includes/FestivityCollection.php:380
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. As "
"per %s, the first has precedence, therefore the Vigil Mass is confirmed as "
"are I Vespers."
msgstr ""

#: includes/FestivityCollection.php:391
#: includes/FestivityCollection.php:392
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. We "
Expand Down Expand Up @@ -525,41 +525,41 @@ msgid "From the Common"
msgstr ""

#. translators: liturgical rank. Keep lowercase
#: includes/enums/LitGrade.php:88 includes/enums/LitGrade.php:127
#: includes/enums/LitGrade.php:90 includes/enums/LitGrade.php:129
msgid "weekday"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:93
#: includes/enums/LitGrade.php:95
msgid "Commemoration"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:98
#: includes/enums/LitGrade.php:100
msgid "Optional memorial"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:103
#: includes/enums/LitGrade.php:105
msgid "Memorial"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:108
#: includes/enums/LitGrade.php:110
msgid "FEAST"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:113
#: includes/enums/LitGrade.php:115
msgid "FEAST OF THE LORD"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:118
#: includes/enums/LitGrade.php:120
msgid "SOLEMNITY"
msgstr ""

#. translators: liturgical rank. Keep lowercase
#: includes/enums/LitGrade.php:123
#: includes/enums/LitGrade.php:125
msgid "celebration with precedence over solemnities"
msgstr ""
28 changes: 14 additions & 14 deletions i18n/es/LC_MESSAGES/litcal.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-19 01:58+0000\n"
"POT-Creation-Date: 2021-12-26 00:07+0000\n"
"PO-Revision-Date: 2021-12-14 00:20+0100\n"
"Last-Translator: Ubuntu <[email protected]>\n"
"Language-Team: Spanish\n"
Expand Down Expand Up @@ -58,7 +58,7 @@ msgstr ""
#: includes/LitCalAPI.php:1361 includes/LitCalAPI.php:1385
#: includes/LitCalAPI.php:1402 includes/LitCalAPI.php:1422
#: includes/LitCalAPI.php:1444 includes/LitCalAPI.php:1458
#: includes/LitCalAPI.php:1472 includes/FestivityCollection.php:385
#: includes/LitCalAPI.php:1472 includes/FestivityCollection.php:386
msgid "Decree of the Congregation for Divine Worship"
msgstr ""

Expand Down Expand Up @@ -269,7 +269,7 @@ msgstr ""
msgid "Vigil Mass"
msgstr ""

#: includes/FestivityCollection.php:338 includes/FestivityCollection.php:365
#: includes/FestivityCollection.php:339 includes/FestivityCollection.php:366
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. "
Expand All @@ -278,7 +278,7 @@ msgid ""
"Vespers I."
msgstr ""

#: includes/FestivityCollection.php:351 includes/FestivityCollection.php:409
#: includes/FestivityCollection.php:352 includes/FestivityCollection.php:410
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. "
Expand All @@ -287,15 +287,15 @@ msgid ""
"evening Mass."
msgstr ""

#: includes/FestivityCollection.php:379
#: includes/FestivityCollection.php:380
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. As "
"per %s, the first has precedence, therefore the Vigil Mass is confirmed as "
"are I Vespers."
msgstr ""

#: includes/FestivityCollection.php:391
#: includes/FestivityCollection.php:392
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. We "
Expand Down Expand Up @@ -525,41 +525,41 @@ msgid "From the Common"
msgstr ""

#. translators: liturgical rank. Keep lowercase
#: includes/enums/LitGrade.php:88 includes/enums/LitGrade.php:127
#: includes/enums/LitGrade.php:90 includes/enums/LitGrade.php:129
msgid "weekday"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:93
#: includes/enums/LitGrade.php:95
msgid "Commemoration"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:98
#: includes/enums/LitGrade.php:100
msgid "Optional memorial"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:103
#: includes/enums/LitGrade.php:105
msgid "Memorial"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:108
#: includes/enums/LitGrade.php:110
msgid "FEAST"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:113
#: includes/enums/LitGrade.php:115
msgid "FEAST OF THE LORD"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:118
#: includes/enums/LitGrade.php:120
msgid "SOLEMNITY"
msgstr ""

#. translators: liturgical rank. Keep lowercase
#: includes/enums/LitGrade.php:123
#: includes/enums/LitGrade.php:125
msgid "celebration with precedence over solemnities"
msgstr ""
28 changes: 14 additions & 14 deletions i18n/fr/LC_MESSAGES/litcal.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-19 01:58+0000\n"
"POT-Creation-Date: 2021-12-26 00:07+0000\n"
"PO-Revision-Date: 2021-12-14 00:20+0100\n"
"Last-Translator: Ubuntu <[email protected]>\n"
"Language-Team: French\n"
Expand Down Expand Up @@ -58,7 +58,7 @@ msgstr ""
#: includes/LitCalAPI.php:1361 includes/LitCalAPI.php:1385
#: includes/LitCalAPI.php:1402 includes/LitCalAPI.php:1422
#: includes/LitCalAPI.php:1444 includes/LitCalAPI.php:1458
#: includes/LitCalAPI.php:1472 includes/FestivityCollection.php:385
#: includes/LitCalAPI.php:1472 includes/FestivityCollection.php:386
msgid "Decree of the Congregation for Divine Worship"
msgstr ""

Expand Down Expand Up @@ -269,7 +269,7 @@ msgstr ""
msgid "Vigil Mass"
msgstr ""

#: includes/FestivityCollection.php:338 includes/FestivityCollection.php:365
#: includes/FestivityCollection.php:339 includes/FestivityCollection.php:366
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. "
Expand All @@ -278,7 +278,7 @@ msgid ""
"Vespers I."
msgstr ""

#: includes/FestivityCollection.php:351 includes/FestivityCollection.php:409
#: includes/FestivityCollection.php:352 includes/FestivityCollection.php:410
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. "
Expand All @@ -287,15 +287,15 @@ msgid ""
"evening Mass."
msgstr ""

#: includes/FestivityCollection.php:379
#: includes/FestivityCollection.php:380
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. As "
"per %s, the first has precedence, therefore the Vigil Mass is confirmed as "
"are I Vespers."
msgstr ""

#: includes/FestivityCollection.php:391
#: includes/FestivityCollection.php:392
#, php-format
msgid ""
"The Vigil Mass for the %s '%s' coincides with the %s '%s' in the year %d. We "
Expand Down Expand Up @@ -525,41 +525,41 @@ msgid "From the Common"
msgstr ""

#. translators: liturgical rank. Keep lowercase
#: includes/enums/LitGrade.php:88 includes/enums/LitGrade.php:127
#: includes/enums/LitGrade.php:90 includes/enums/LitGrade.php:129
msgid "weekday"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:93
#: includes/enums/LitGrade.php:95
msgid "Commemoration"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:98
#: includes/enums/LitGrade.php:100
msgid "Optional memorial"
msgstr ""

#. translators: liturgical rank. Keep Capitalized
#: includes/enums/LitGrade.php:103
#: includes/enums/LitGrade.php:105
msgid "Memorial"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:108
#: includes/enums/LitGrade.php:110
msgid "FEAST"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:113
#: includes/enums/LitGrade.php:115
msgid "FEAST OF THE LORD"
msgstr ""

#. translators: liturgical rank. Keep UPPERCASE
#: includes/enums/LitGrade.php:118
#: includes/enums/LitGrade.php:120
msgid "SOLEMNITY"
msgstr ""

#. translators: liturgical rank. Keep lowercase
#: includes/enums/LitGrade.php:123
#: includes/enums/LitGrade.php:125
msgid "celebration with precedence over solemnities"
msgstr ""
Loading

0 comments on commit 3e02918

Please sign in to comment.