* Add an entry of your plugin to [[Plugins3.4]]. See [[Plugin list legend]] for meaning of columns. Please use these meanings and pay attention to details; this page is machine readable.

* Create a new wiki page, and refer to that page here, with a short description of what the plugin does

* Create a new wiki page, and refer to that page here, with a short description of what the plugin does

−

== Internationalize it ==

+

== Internationalize it (3.2 and later) ==

−

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:

+

−

==== Translation function ====

+

This section describes a method of internationalizing your code for versions of Gramps 3.2 and later. The previous section describes a new method for Gramps 3.1 and earlier.

−

* 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:

+

−

mytranslation = {

+

Please see [[Addons development]] for complete details.

−

'Name' : "Nom"

+

−

}

+

−

+

−

from gettext import gettext

+

−

import locale

+

−

lang = locale.getlocale()[0]

+

−

if lang:

+

−

lang = lang.split('_')[0]

+

−

def _(string):

+

−

if lang == 'fr':

+

−

return mytranslation.get(string, gettext(string))

+

−

else:

+

−

return gettext(string)

+

−

Change here 'fr' by the language code of your language

+

Also, have a look at [[Coding_for_translation#Tips_for_writing_a_translatable_report|Coding for translation]].

−

* If the report becomes part of GRAMPS, it will suffice to delete this code and replace it by

+

−

from gettext import gettext as _

+

−

* Note that you only need to include strings that are not yet a part of GRAMPS, as those will be translated automatically by the gettext routine

+

==== Pitfalls ====

==== Pitfalls ====

* We support right to left languages like Arabic, so never constructs text parts by concatenation of pieces. Always use full sentences/paragraphs with variable substitution, so that a right to left language can translate it correctly.

* We support right to left languages like Arabic, so never constructs text parts by concatenation of pieces. Always use full sentences/paragraphs with variable substitution, so that a right to left language can translate it correctly.

−

==== Template ====

−

* There is a possible [[Media:additional.pot.gz|template]] which lists references.

Pitfalls

We support right to left languages like Arabic, so never constructs text parts by concatenation of pieces. Always use full sentences/paragraphs with variable substitution, so that a right to left language can translate it correctly.