Changes

From Gramps

Third-party Addons

1,010 bytes added, 16:09, 12 November 2008
Plugin writers
[[Gramps_3.0_Wiki_Manual_-_Gramplets|Gramplets]] are gadgets available in the Gramplet view of GRAMPS. The official ones are documented in the [[Gramps_3.0_Wiki_Manual_-_Gramplets|Manual]]
= Information for Plugin writers =
Have you written a plugin for GRAMPS you want to share with the world? Here's how you do it:
* Upload the code to this wiki
* Add a description of your plugin to this page.
 
There is a big possibility that you are not a native English speaker and want your report in your mother tongue. To enable others to use your report, and make it easy to include your report later in GRAMPS without large changes, do the following for text:
 
* Suppose you have a string Name, which you want for your own use in French, so Nom. Then write a translation function with the name _.
* For every string, pass it through your translation function: _("Name")
* Your translation function should then look like this:
 
from gettext import gettext
import locale
mytranslation = {
'Name' : "Nom"
}
lang = locale.getlocale()[0]
if lang:
lang = lang.split('_')[0]
def _(string):
if lang == 'fr':
return mytranslation.get(string, gettext(string))
else:
gettext(string)
 
Change here 'fr' by the language code of your language
* If the report becomes part of GRAMPS, it will suffice to delete this code and replace it by
from gettext import gettext as _

Navigation menu