4

I would like to start the genealogy program Gramps with a language (English) other than my locale one (Spanish). I successfully tried to run Gramps in terminal via

 LANG=en_GB gramps

I would like, now, to add this command in the .desktop file in /usr/share/applications/ to be able to start Gramps in the English language, but I cannot get it to run like this

EXEC=LANG=en_GB gramps

What can I do?

Edit: For those interested: the suggestion by Jacob down below helped me to start gramps in the given language English via the .desktop file. In addition, I have used the following two commands so that gramps in terminal starts in English as well:

echo 'LANGUAGE=en_GB PATH=/usr/bin/gramps:$PATH' >> ~/.bash_profile
source ~/.bash_profile
echo 'alias gramps='LANGUAGE=en_GB /usr/bin/gramps'' >> ~/.bashrc
source ~/.bashrc

Logout and login!

2

3 Answers 3

3

I installed Gramp and tried it here, and this should really work:

Exec=/bin/bash -c "LANGUAGE=en_GB gramps"

LANGUAGE= takes precedence over LANG=

Note

Make sure you run the application from the local .desktop file: After editing the local one, make sure you log out / in before running it again.

10
  • 1
    @TilHund I will try and install Gramps, see what happens :) May 5, 2015 at 17:56
  • 1
    Hi @TilHund if this solves your problem, would you be so kind to accept the answer? (on the left, below the up and down arrows). It makes clear the question is not "unanswered". The other thing: run the command: LANGUAGE=en_GB.utf8 gramps from terminal. May 6, 2015 at 6:58
  • 1
    en_GB.utf8 is not a valid LANGUAGE value. LANGUAGE expects a colon separated list of language codes without any ".utf8" or ".UTF-8" extension. The effect in this case is that it falls back to the original string, and even if it's English it's not the British translation. It should be LANGUAGE=en_GB. May 6, 2015 at 9:47
  • 1
    Great! I'm sure it showed English, but probably not the British translation (if there is a British translation for gramps). May 6, 2015 at 10:04
  • 1
    Done my edit too
    – Til Hund
    May 6, 2015 at 11:19
2

A more generic way, compared to playing with a .desktop file, ~/.bashrc, etc., is to create the file ~/bin/gramps and give it this contents:

#!/bin/sh
export LANGUAGE=en_GB
exec /usr/bin/gramps $@

Also run chmod +x ~/bin/gramps. Then, next time you log in, English will be the display language however you start gramps.

2
  • Why do we actually have to log out and in again?
    – Til Hund
    May 6, 2015 at 11:17
  • 2
    @TilHund After you created the directory ~/bin, the directory needs to "show up" in $PATH. You can do that either by running source ~/.profile or log out /in. In the case of creating (copying) a local .desktop file, Unity needs to switch its "focus" from the global one to the local one. May 6, 2015 at 11:22
1

My workaround:

[Desktop Entry]
Encoding=UTF-8
Name=PhotoFiltre Studio X
Comment=PlayOnLinux
Type=Application
**Exec=env LC_ALL="pl_PL.UTF8" /usr/share/playonlinux/playonlinux --run "PhotoFiltre Studio X" %F**
Icon=/home/gajowy/.PlayOnLinux//icones/full_size/PhotoFiltre Studio X
Name[fr_FR]=PhotoFiltre Studio X
StartupWMClass=pfstudiox.exe
Categories=Graphics;RasterGraphics;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .