Changes

Jump to: navigation, search

Specification:Relationship Calculator

12 bytes added, 15:59, 11 December 2009
m
How to write a relationship calculator for version 3.0
* Translators do not have to worry about trying to translate strings such as "third cousin twice removed" into a local phrase that has no equivalent.
==How to write a relationship calculator for version 3.01==
The relationship calculator changed for version 3.0. Logic has been separated from translation, which will allow code improvements to occur more easily, being available immediately in all translated modules.
:where <code>RelationshipCalculatorClass</code> is the class you defined inheriting from Relationship.RelationshipCalculator, and the items in quotes are language identifiers that '''may possibly''' be associated with your language. For example, different systems use <code>ru</code>, <code>RU</code>, <code>ru_RU</code>, <code>koi8r</code>, <code>ru_koi8r</code>, <code>russian</code>, <code>Russian</code>, <code>ru_RU.koi8r</code>, etc. to identify the Russian language.
That's it for the requirements. The example <code>relcalc</code> plugins can be found in <code>src/Relationship.py</code> and <code>src/plugins/rel/rel_it.py</code> or <code>src/plugins/rel/rel_nl.py</code>.
You are further strongly adviced to run the same tests as are present at the bottom of those files. If you have obtained GRAMPS svn in <code>/home/me/grampssvn</code>, then you can run the test for eg. rel_it.py as follows in a terminal:
cd /home/me/grampssvn
export PYTHONPATH=/home/me/grampssvn/src
python src/plugins/rel/rel_it.py
==How to write a relationship calculator in 2.2.x==

Navigation menu