Explanation of how to add or change the holidays appearing on the output of the calendars in Gramps. This includes the Anniversary and Birthday Text Report, the Calendar Graph Report, and the Web Calendar.

+

Explanation of how to add or change the holidays appearing on the output of the calendars in Gramps. This includes the Text:''Birthday and Anniversary Report'', the Graphical:''Calendar'' Report, and the ''Web Calendar''.

If you would like to add your country's holidays to the calendar, then you can add them to the file [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/plugins/lib/holidays.xml.in?view=markup holidays.xml.in]. Here, you can add recurring annual events in a variety of ways. The format is generally:

If you would like to add your country's holidays to the calendar, then you can add them to the file [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/plugins/lib/holidays.xml.in?view=markup holidays.xml.in]. Here, you can add recurring annual events in a variety of ways. The format is generally:

<code>

<code>

−

<?xml version="1.0" encoding="iso-8859-1"?>

+

<?xml version="1.0" encoding="UTF-8"?>

<calendar>

<calendar>

−

<country name=COUNTRYNAME>

+

<country _name=COUNTRYNAME>

<date name=NAME value=VALUE type=TYPE offset=OFFSET if=EXPRESSION />

<date name=NAME value=VALUE type=TYPE offset=OFFSET if=EXPRESSION />

...

...

</country>

</country>

−

<country name=COUNTRYNAME>

+

<country _name=COUNTRYNAME>

<date name=NAME value=VALUE type=TYPE offset=OFFSET if=EXPRESSION />

<date name=NAME value=VALUE type=TYPE offset=OFFSET if=EXPRESSION />

...

...

Line 83:

Line 80:

<code>

<code>

−

<?xml version="1.0" encoding="iso-8859-1"?>

+

<?xml version="1.0" encoding="UTF-8"?>

<calendar>

<calendar>

<country name="United States">

<country name="United States">

Line 119:

Line 116:

[[Category:Translators/Categories]]

[[Category:Translators/Categories]]

[[Category:Developers/General]]

[[Category:Developers/General]]

+

[[Category:Reports]]

Revision as of 09:39, 3 March 2012

Explanation of how to add or change the holidays appearing on the output of the calendars in Gramps. This includes the Text:Birthday and Anniversary Report, the Graphical:Calendar Report, and the Web Calendar.

If you would like to add your country's holidays to the calendar, then you can add them to the file holidays.xml.in. Here, you can add recurring annual events in a variety of ways. The format is generally:

where each of the capitalized words would be filled in with appropriate values, as follows. All but NAME and VALUE are optional.

COUNTRYNAME => "United States", "China", etc. You don't have to make these countries, however. You can make these just a "holiday set" which could be "Christian", "Muslim", "Eastern European", etc. These names can be selected from a list when running calendar-related reports. You can use your own language for this name.

NAME => the text to appear on the calendar

TYPE => "secular", "religious", "personal", "informational" (This isn't currently used in the calendar, but could be. Use these keywords, untranslated.)

EXPRESSION => a python expression that must be true for this to appear on the calendar. You can use y, m, and d variables (for year, month, and day, all integers). See VALUE for examples.

VALUE =>

"YEAR/MONTH/DAY"

"2012/12/25"

"*/12/25"

"YEAR/MONCODE/DAY"

"2012/dec/25"

"*/dec/25"

"YEAR/NUMBER/DAYCODE/MONCODE" (nth day of week in month, year)

"2012/1/mon/dec" (first monday in december, 2012)

"*/-1/tue/dec" (last tuesday in december, every year)

"> EXPRESSION" (which evaluates to one of the previous two types of VALUES). Current useful expression values are:

NUMBER => number of weekday in month. For example, "every 3rd Tuesday in April" would be "*/3/tue/apr". NUMBER can also be negative, which means it is counted from the end of the month. "last Tuesday in April 2007" could be "2007/-1/tue/4"

DAYCODE => "mon", "tue", "wed", "thu", "fri", "sat", or "sun". Do not translate these words; use all lowercase.

DAYCODE (may be negative), the next DAYCODE that is either the same as this day, or the next(+)/prev(-) one.

"workday" or "weekend" (may be negative) - the next workday/weekend that is on this day, or the next/prev

Translations

Holiday entries are generally written for a specific country, and thus typcailly don't need to be written for more than one language. However, it might be appropriate to have your entries country name and holiday text be translated into the language that Gramps is running in. To make a country name or holiday name get translated, simply precede the name of the XML item with an underscore. For example:

In this example, "Jewish Holidays", "Purim", and "Passover" will be looked up in the Gramps gettext system for translations. If you would like to help add those translations, please see Translating GRAMPS.