Discussion:
[Gramps-users] changing gramps language
Duncan Lithgow
2006-02-27 10:41:12 UTC
Permalink
Hi,

How do I start gramps in a different language? I want to send some
reports to some German members of my family.

I've asked this before but this time I'd like to report it as missing in
the man pages for gramps. The options described in the man pages are:
[-?|--help] [--usage] [--version] [-O|--open= FILE [-f|--format=
FORMAT]] [-i|--import= FILE [-f|--format= FORMAT]] [-i|--import= ...]
[-o|--output= FILE [-f|--format= FORMAT]] [-a|--action= ACTION]
[-p|--options= OPTIONSTRING]] [ FILE ]

That's cool, but could someone add the 'locale' option or whatever it
is, then I'll be able to look it up next time I forget.

Any chance a dialogue could be added to the reports so they can be
produced in other languages without changing the whole Gramps gui
language (assuming the language is available on that system)?

Duncan
--
Duncan Lithgow <***@lithgow-schmidt.dk>
Don Allingham
2006-02-27 10:46:01 UTC
Permalink
$ LANG=de_DE gramps

This should do the trick.

Don

On Mon, 2006-02-27 at 13:41 +0100, Duncan Lithgow wrote:
> Hi,
>
> How do I start gramps in a different language? I want to send some
> reports to some German members of my family.
>
> I've asked this before but this time I'd like to report it as missing in
> the man pages for gramps. The options described in the man pages are:
> [-?|--help] [--usage] [--version] [-O|--open= FILE [-f|--format=
> FORMAT]] [-i|--import= FILE [-f|--format= FORMAT]] [-i|--import= ...]
> [-o|--output= FILE [-f|--format= FORMAT]] [-a|--action= ACTION]
> [-p|--options= OPTIONSTRING]] [ FILE ]
>
> That's cool, but could someone add the 'locale' option or whatever it
> is, then I'll be able to look it up next time I forget.
>
> Any chance a dialogue could be added to the reports so they can be
> produced in other languages without changing the whole Gramps gui
> language (assuming the language is available on that system)?
>
> Duncan
--
Don Allingham <***@comcast.net>
d***@cs.brynmawr.edu
2006-02-27 12:17:19 UTC
Permalink
Don Allingham <***@comcast.net> said:

> $ LANG=de_DE gramps
>
> This should do the trick.
>
> Don
>
> On Mon, 2006-02-27 at 13:41 +0100, Duncan Lithgow wrote:
> > Hi,
> >
> > How do I start gramps in a different language? I want to send some
> > reports to some German members of my family.
> >
> > I've asked this before but this time I'd like to report it as missing in
> > the man pages for gramps. The options described in the man pages are:
> > [-?|--help] [--usage] [--version] [-O|--open= FILE [-f|--format=
> > FORMAT]] [-i|--import= FILE [-f|--format= FORMAT]] [-i|--import= ...]
> > [-o|--output= FILE [-f|--format= FORMAT]] [-a|--action= ACTION]
> > [-p|--options= OPTIONSTRING]] [ FILE ]
> >
> > That's cool, but could someone add the 'locale' option or whatever it
> > is, then I'll be able to look it up next time I forget.
> >
> > Any chance a dialogue could be added to the reports so they can be
> > produced in other languages without changing the whole Gramps gui
> > language (assuming the language is available on that system)?

Duncan,

I don't think that is likely. Currently, gramps uses the LANG variable which
is a shell-level setting. That means that Python, and everything on down, may
make use of it to display localized items. By the way, Don's suggestion of how
to change the language will work for any Linux program (given that they have
the translated strings and use gettext). As you can imagine, the system to
quickly convert a lot of strings takes up a bit of memory, and is designed to
happen when Python first starts.

It might be possible to change languages on the fly, but having fine control
so that the GUI is in one language and the reports in another is beyond what
the GNU gettext system was designed to do. If the gettext system supported
subsystems for which each could be in a different language, and could change
dynamically, I bet we could utilize that very easily.

-Doug

> > Duncan
> --
> Don Allingham <***@comcast.net>
>



--
Duncan Lithgow
2006-02-27 18:24:04 UTC
Permalink
On Mon, 2006-02-27 at 14:15 +0000, ***@cs.brynmawr.edu wrote:
> Don Allingham <***@comcast.net> said:
>
> > $ LANG=de_DE gramps
> >
> > This should do the trick.
thanks - that's a great thing to learn for all programs!

Duncan
--
Duncan Lithgow <***@lithgow-schmidt.dk>
Duncan Lithgow
2006-02-27 18:46:03 UTC
Permalink
Oops!! That didn't work after all...

***@ubuntu:~$ LANG=de_DE gramps

(gramps.py:9244): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Spell.py: Error setting language
/usr/share/gramps/gramps_main.py:123: GtkWarning: locale not supported
by C library
args, const.popt_table)
/usr/share/gramps/TreeTips.py:257: DeprecationWarning: Class TreeTips is
already GObject-registered; Please note that classes containing any of
the attributes __gtype_name__, __gproperties__, or __gsignals__ are now
automatically registered.
gobject.type_register(TreeTips)
Trying to open: ...
No data was given -- will launch interactive session.
To use in the command-line mode, supply at least one input file to
process.
Launching interactive session...
/usr/share/gramps/gramps_main.py:200: GtkWarning: Theme directory
48x48/mimetypes of theme Snow-Apple has no size field

self.topWindow.show()
***@ubuntu:~$

Started on the command line it doesn't seem to check if there is a
default file to open.

And then if I try it with the correct file I get:

***@ubuntu:~$ LANG=de_DE
gramps ../../media/hda1/duncan-win/genealogy/database/lithgow-schmidt.grdb

(gramps.py:9339): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Spell.py: Error setting language
/usr/share/gramps/gramps_main.py:123: GtkWarning: locale not supported
by C library
args, const.popt_table)
/usr/share/gramps/TreeTips.py:257: DeprecationWarning: Class TreeTips is
already GObject-registered; Please note that classes containing any of
the attributes __gtype_name__, __gproperties__, or __gsignals__ are now
automatically registered.
gobject.type_register(TreeTips)
Trying to
open: ../../media/hda1/duncan-win/genealogy/database/lithgow-schmidt.grdb ...
Type: GRAMPS database
Opened successfully!
/usr/share/gramps/gramps_main.py:200: GtkWarning: Theme directory
48x48/mimetypes of theme Snow-Apple has no size field

self.topWindow.show()
***@ubuntu:~$

So, now it's opened but still failed to chance the language.

Duncan
--
Duncan Lithgow <***@lithgow-schmidt.dk>
Eero Tamminen
2006-02-27 19:09:09 UTC
Permalink
Hi,

On Monday 27 February 2006 22:46, Duncan Lithgow wrote:
> Oops!! That didn't work after all...
>
> ***@ubuntu:~$ LANG=de_DE gramps
>
> (gramps.py:9244): Gtk-WARNING **: Locale not supported by C library.
> Using the fallback 'C' locale.

Maybe you haven't installed files needed by the German locale to your
machine?

Check following directories:
/usr/lib/locale/
/usr/share/locale/

Also, on SuSE 9.1 I need to add .utf-8 and the end of the locale name
(e.g. fi_FI.utf-8), although on e.g. Debian systems they work without it.


- Eero
Alex Roitman
2006-02-27 19:10:09 UTC
Permalink
Duncan,

On Mon, 2006-02-27 at 21:46 +0100, Duncan Lithgow wrote:
> Oops!! That didn't work after all...
>
> ***@ubuntu:~$ LANG=de_DE gramps
>
> (gramps.py:9244): Gtk-WARNING **: Locale not supported by C library.
> Using the fallback 'C' locale.

Do you have German locale? It may be called differently.
Say 'locale -a' on the command line to see the available locales.
If you don't have de_DE or german or deutsch or somesuch,
you will need to generate German locale. It may be that you
need to set e.g. de_DE.utf8 instead, just see what's available.

For me (Debian system), re-generating locales can be
done by:
$ sudo dpkg-reconfigure locales
where I can select the ones I need and generate them.
Also, on some systems, you also need to set LANGUAGE
in addition to LANG:
$ LANG=german LANGUAGE=german gramps


> Started on the command line it doesn't seem to check if there is a
> default file to open.

This is strange. Does the database autoload for you when
starting gramps from the menu?

Alex

--
Alexander Roitman http://www.gramps-project.org
Eero Tamminen
2006-02-27 19:04:09 UTC
Permalink
Hi,

On Monday 27 February 2006 16:15, ***@mainline.brynmawr.edu wrote:
> It might be possible to change languages on the fly, but having fine
> control so that the GUI is in one language and the reports in another is
> beyond what the GNU gettext system was designed to do.
> If the gettext system supported subsystems for which each could be in a
> different language, and could change dynamically, I bet we could utilize
> that very easily.

It's not that easy.

The translated text can be cached at many levels in the system, for example
in Gtk widgets (which would require re-creating the UI after language
change), in Gramps Python classes (date etc which would need to
be re-imported) etc.

It's *much* easier just to restart the program.


- Eero
Duncan Lithgow
2006-02-27 19:43:03 UTC
Permalink
On Mon, 2006-02-27 at 23:17 +0200, Eero Tamminen wrote:

> It's not that easy.
>
> The translated text can be cached at many levels in the system, for example
> in Gtk widgets (which would require re-creating the UI after language
> change), in Gramps Python classes (date etc which would need to
> be re-imported) etc.
But I am only talking about the reports, not the whole interface. Is
_that_ really all in different places?
--
Duncan Lithgow <***@lithgow-schmidt.dk>
Eero Tamminen
2006-02-27 20:11:21 UTC
Permalink
Hi,

On Monday 27 February 2006 23:43, Duncan Lithgow wrote:
> > The translated text can be cached at many levels in the system, for
> > example in Gtk widgets (which would require re-creating the UI after
> > language change), in Gramps Python classes (date etc which would need
> > to be re-imported) etc.
>
> But I am only talking about the reports, not the whole interface. Is
> _that_ really all in different places?

The report output doesn't use Gtk widgets, but the report plugins still use
the same Python classes (with already initialized localized strings) as rest
of the Gramps.

If you'd like to generate German reports, but aren't familiar enough with
the language to use German Gramps UI, you could always try the command
line interface, its always in English. Maybe Alex could point to examples
of its usage?

- Eero
Alex Roitman
2006-02-27 22:37:04 UTC
Permalink
Duncan,

On Mon, 2006-02-27 at 22:43 +0100, Duncan Lithgow wrote:
> But I am only talking about the reports, not the whole interface. Is
> _that_ really all in different places?

Once you set the locale, everything will be in that language,
both interface and reports.

Having interface in one language while reports in another one
is not impossible, but hard enough and not all that useful so
that nobody wants to do it.

On Tue, 2006-02-28 at 00:24 +0200, Eero Tamminen wrote:
> If you'd like to generate German reports, but aren't familiar enough with
> the language to use German Gramps UI, you could always try the command
> line interface, its always in English. Maybe Alex could point to examples
> of its usage?

Yes, as Eero mentions, you can cheat the system by going without
interface at all and using the command line instead:-) Both the
user manual and the man page describe it in detail, so I won't
be duplicating it all here. In short, you want something like this:

$ LANG=german LANGUAGE=german gramps -O myfile.grdb -a report -p name=det_descendant_report,off=pdf,of=/home/user/myfile.pdf,id=I0001

as a single line (mailers may break this command, but
we know better :-)

You can specify any option available for the report. Unspecified
options will use last used values, or the default if none last used
is found.

To learn about what options are available for this report, do this:
$ gramps -O myfile.grdb -a report -p name=det_descendant_report,show=all

To see what option "blah" does, do this:
$ gramps -O myfile.grdb -a report -p name=det_descendant_report,show=blah

And so on. Hope this helps,
Alex

--
Alexander Roitman http://www.gramps-project.org
B***@UGent.be
2006-02-28 08:02:02 UTC
Permalink
Concerning the command to call gramps in a different language.
I did on command line
$ sudo dpkg-reconfigure locales
to install the locales I want (always use the UTF-8 version), and I call eg
dutch version with the command
$ LANGUAGE=nl_BE:nl LANG=nl_BE.UTF-8 /usr/bin/gramps
which is a bit more elaborated from the command Alex gave.
This can be easily put into the start menu under the english Gramps, so
you can
access it in one click.

Benny

Quoting Alex Roitman <***@gramps-project.org>:

> Duncan,
>
> On Mon, 2006-02-27 at 22:43 +0100, Duncan Lithgow wrote:
>> But I am only talking about the reports, not the whole interface. Is
>> _that_ really all in different places?
>
> Once you set the locale, everything will be in that language,
> both interface and reports.
>
> Having interface in one language while reports in another one
> is not impossible, but hard enough and not all that useful so
> that nobody wants to do it.
>
> On Tue, 2006-02-28 at 00:24 +0200, Eero Tamminen wrote:
>> If you'd like to generate German reports, but aren't familiar enough with
>> the language to use German Gramps UI, you could always try the command
>> line interface, its always in English. Maybe Alex could point to examples
>> of its usage?
>
> Yes, as Eero mentions, you can cheat the system by going without
> interface at all and using the command line instead:-) Both the
> user manual and the man page describe it in detail, so I won't
> be duplicating it all here. In short, you want something like this:
>
> $ LANG=german LANGUAGE=german gramps -O myfile.grdb -a report -p
> name=det_descendant_report,off=pdf,of=/home/user/myfile.pdf,id=I0001
>
> as a single line (mailers may break this command, but
> we know better :-)
>
> You can specify any option available for the report. Unspecified
> options will use last used values, or the default if none last used
> is found.
>
> To learn about what options are available for this report, do this:
> $ gramps -O myfile.grdb -a report -p name=det_descendant_report,show=all
>
> To see what option "blah" does, do this:
> $ gramps -O myfile.grdb -a report -p name=det_descendant_report,show=blah
>
> And so on. Hope this helps,
> Alex
>
> --
> Alexander Roitman http://www.gramps-project.org
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Duncan Lithgow
2006-02-28 09:17:02 UTC
Permalink
On Tue, 2006-02-28 at 10:31 +0100, ***@UGent.be wrote:

> $ LANGUAGE=nl_BE:nl LANG=nl_BE.UTF-8 /usr/bin/gramps
That one works great!
$ LANGUAGE=de_DE:de LANG=de_DE.UTF-8 /usr/bin/gramps

Since it is possible to open two concurrent versions of gramps (with
gui) at once - I still get the feeling that at the _very end_ of the
reports dialogue one could have an option which checks available
languages and sends a command to create a new instance (is that what
it's called?) of gramps. It could for example throw the command

$ LANG=german LANGUAGE=german gramps -O myfile.grdb -a report -p
name=det_descendant_report,off=pdf,of=/home/user/myfile.pdf,id=I0001

to bash and thereby create a report in german - from an english
interface.

The reason I'm going on about this is not so much because it's a big
problem for me, but I think that making it easier for people to create
reports in other languages would make it so useful for sending reports
to relatives - who the user _cannot_ speak to because of language
barriers.

I'm lucky that my sons family spans 6 countries but only three
languages, but for some people this must be a real obstacle.

Duncan
--
Duncan Lithgow <***@lithgow-schmidt.dk>
Alex Roitman
2006-02-28 17:04:09 UTC
Permalink
Duncan,

On Tue, 2006-02-28 at 12:17 +0100, Duncan Lithgow wrote:
> Since it is possible to open two concurrent versions of gramps (with
> gui) at once - I still get the feeling that at the _very end_ of the
> reports dialogue one could have an option which checks available
> languages and sends a command to create a new instance (is that what
> it's called?) of gramps. It could for example throw the command
>
> $ LANG=german LANGUAGE=german gramps -O myfile.grdb -a report -p
> name=det_descendant_report,off=pdf,of=/home/user/myfile.pdf,id=I0001
>
> to bash and thereby create a report in german - from an english
> interface.

True, this can be done.

> The reason I'm going on about this is not so much because it's a big
> problem for me, but I think that making it easier for people to create
> reports in other languages would make it so useful for sending reports
> to relatives - who the user _cannot_ speak to because of language
> barriers.

This sounds like a good project for somebody starting to hack
on gramps. If you want to, feel free to add this to the RFE
list on http://gramps.sourceforge.net/projects/gramps

Alex

--
Alexander Roitman http://www.gramps-project.org
Duncan Lithgow
2006-03-01 17:20:03 UTC
Permalink
On Tue, 2006-02-28 at 11:02 -0800, Alex Roitman wrote:

> This sounds like a good project for somebody starting to hack
> on gramps. If you want to, feel free to add this to the RFE
> list on http://gramps.sourceforge.net/projects/gramps
I've been thinking about getting into some python hacking - maybe.

The link gives me a 404 and I don't know what RFE is, please help.

Duncan
--
Duncan Lithgow <***@lithgow-schmidt.dk>
Alex Roitman
2006-03-01 17:31:03 UTC
Permalink
Duncan,

On Wed, 2006-03-01 at 20:20 +0100, Duncan Lithgow wrote:
> On Tue, 2006-02-28 at 11:02 -0800, Alex Roitman wrote:
>
> > This sounds like a good project for somebody starting to hack
> > on gramps. If you want to, feel free to add this to the RFE
> > list on http://gramps.sourceforge.net/projects/gramps
> I've been thinking about getting into some python hacking - maybe.
>
> The link gives me a 404 and I don't know what RFE is, please help.

Sorry, I got sloppy and posted the wrong link.
Here's the correct link for our project page on SourceForge site:
http://sourceforge.net/projects/gramps

The RFE is the acronym Request for Features/Enhancements, but I
can see that now the link is called Feature Requests. Anyway, here
it is directly:
http://sourceforge.net/tracker/?group_id=25770&atid=385140

Adding anything to that tracker is far from guaranteeing
its realization, but at least it won't be forgotten.

Alex

--
Alexander Roitman http://www.gramps-project.org
Duncan Lithgow
2006-03-03 16:34:03 UTC
Permalink
On Wed, 2006-03-01 at 11:29 -0800, Alex Roitman wrote:
> Adding anything to that tracker is far from guaranteeing
> its realization, but at least it won't be forgotten.
added as #1442640

duncan
--
Linux user #372812, GPG Encryption Key ID 21A8C63A, available on
Jabber/GoogleTalk, msn and yahoo with the help of Gaim. Yes - a nerd.
Continue reading on narkive:
Loading...