Setting gnucash language

I am running gnucash 2.6.4-65.9 on Gnome 3.14.1. My locale is English(GB). However, since I am living in Germany, I want to run gnucash (only gnucash) in German.

I can do it from a Gnome terminal by

LANGUAGE=de_DE.UTF-8 LANG=de_DE.UTF-8 gnucash

But I prefer to start gnucash from my desktop rather than opening a terminal each time.

Gnucash itself does not have a language setting, the properties behind the desktop icon does not allow me to enter the language settings on launching gnucash, the dconf editor does not have a language setting for gnucash.

Can anyone help me to find a more convenient way of starting gnucash in German than the above?

Cheers
Harvey

You should be able to do that by editing the menu entry

Which ‘menu entry’ are you referring to?

The menu entry to start the program. In KDE it is easy I don’t do Gnome but would suspect it is not hard. Try a right click on the menu icon. If you use a shortcut you can edit the call to the program there also just edit the properties of the short cut.

I don’t think GNOME comes with a menu editor any more.

But you can copy the file /usr/share/applications/gnucash.desktop to ~/.local/share/applications/ and edit the copy manually with a text editor (change the “Exec=” line accordingly).
You could edit /usr/share/applications/gnucash.desktop directly as well (for system-wide effect), but then your changes would get lost whenever gnucash is updated/reinstalled.
You could of course also create a file /usr/share/applications/german-gnucash.desktop (or ~/.local/share/applications/german-gnucash.desktop) with the same content as the original, only the Exec line changed (and maybe “Name=” as well to keep them apart), to have an additional, german, menu entry… This wouldn’t even get overwritten by updates, as no package contains a file /usr/share/applications/german-gnucash.desktop. :wink:

There is indeed something that looks like a menu editor in Gnome called ‘Main Menu’ under ‘All settings’. But it is apparently not possible to apply changes to the command line if it is different from the system default. In other words, it seems not to be very useful.

I have tried wolfi323’s suggestion to edit the /usr/share/applications/gnucash.desktop without success (but I don’t really understand what I am doing!):

  1. I can find no file gnucash.desktop in /usr/share/applications/, only one called gnucash.
  2. Even if I copy the file called gnucash to ~/.local/share/applications/gnucash.desktop and edit the command line with success, it seems to have no effect when starting gnucash from the desktop. I always get the English version (and by the way, the ‘Main Menu’ entry for gnucash then shows the edited command line.
    Lost :\ and unhappy :frowning:

Hm, I don’t have anything like that at all here in GNOME’s settings.
Maybe that’s some extension?

  1. I can find no file gnucash.desktop in /usr/share/applications/, only one called gnucash.

It must be called gnucash.desktop, otherwise you wouldn’t have a menu entry at all.
And you state in 2. that you copied gnucash.desktop, so how did you do that if it isn’t there? lol!

Does GNOME now omit the file endings like Windows does? :open_mouth:

  1. Even if I copy the file called gnucash to ~/.local/share/applications/gnucash.desktop and edit the command line with success, it seems to have no effect when starting gnucash from the desktop. I always get the English version (and by the way, the ‘Main Menu’ entry for gnucash then shows the edited command line.

You might have to logout/login that GNOME recognizes the change.
I don’t use GNOME, so cannot help further I’m afraid. In KDE you could run “kbuildsycoca4” to refresh its menu cache.

Maybe post your file if you are not sure whether you edited it correctly.

Well, I ran nautilus now, and if you enter the folder /usr/share/application, it indeed shows the “Name” entry of the .desktop file instead of the filename.
Great thing to do for a file manager…:sarcastic:
And so predictable, why doesn’t it do the same for .desktop files in ~/.local/share/applications/?

Well, I know why I don’t use GNOME…:stuck_out_tongue:

But believe me, the file is actually called “gnucash.desktop”. :wink:

I agree, it seems to be sheer chaos! I extended the command line in /usr/share/applications/ in the gnucash properties as root. Of course, it was accepted. On logging in again as a normal (Gnome) user, however, Gnucash was no longer available as an application! - just gone, completely disappeared from the Gnome applications, zilch. Why? Because the gnucash file in /usr/share/applications/ had renamed itself as gnucash.desktop! (I say ‘renamed itself’ because I did not do it, I had just closed the properties window and everything had seemed as before). I could only start gnucash from a terminal… and got the English version, although the command line in /usr/share/applications/gnucash.desktop asked for German.

After I had reset the command line in /usr/share/applications/gnucash.desktop everything returned to ‘normal’. I cannot fathom this out at all! As I say … sheer chaos!

No, the file definitely did not “rename itself”.
I would guess that you did something wrong when editing it, or GNOME does not like setting environment variables in the Exec line.
At least this sounds like GNOME/nautilus did not recognize the file “gnucash.desktop” as valid desktop file any more. (and before you logged out, nautilus probably just didn’t refresh its directory view to the new content)

I could only start gnucash from a terminal… and got the English version, although the command line in /usr/share/applications/gnucash.desktop asked for German.

Of course. If you run it from the command line, the .desktop file is not used at all.

After I had reset the command line in /usr/share/applications/gnucash.desktop everything returned to ‘normal’. I cannot fathom this out at all! As I say … sheer chaos!

Well, you could try to put the Exec command into quotes, like this:

Exec="LANGUAGE=de_DE.UTF-8 LANG=de_DE.UTF-8 gnucash %f"

In KDE it definitely works fine (even without quotes). I’ll have to try myself in GNOME first though.

I thought maybe my mistake may have been leaving out the “Exec=”. But the behaviour is identical whether or not 'Exec=" is included and whether or not the “LANGUAGE…%f” is in quotes or not.
In every above case, when the command line is edited, Gnucash becomes no longer available to the Gnome shell, either as root or as normal user.

You are right about the renaming. Under Gnome, the icon subscript is GnuCash, but the actual (not shown) file name is gnucash.desktop. Nautilus only shows the Properties ‘Name’ field as the icon subscript, which is not the same as file name which seems to remain almost totally inaccessible.

(I got confused about the renaming of the file, because a different file browser (i.e. not Nautilus, no idea what this other one is called) comes up sometimes when searching for files and there the real file name is displayed. Very confusing)

Of course.

I was getting used to Gnome, but this behaviour is making me nervous. I could never find a KDE theme that I liked. How can I change to KDE?

You may not omit the “Exec=”!
But I tried myself now and it is true that GNOME doesn’t like those envvars in the Exec line and doesn’t show the entry if they are there (and double-clicking on it in nautilus only gives an error that gnucash couldn’t be started).

I have a better idea though:
Create a script named “gnucash” that runs it with those envvars set, and put it to /usr/local/bin/. As /usr/local/bin/ is in the path before /usr/bin/, your script will get called instead of gnucash. This will also work for the command line… :wink:
The script should probably look like this:

#!/bin/sh
LANGUAGE=de_DE.UTF-8 LANG=de_DE.UTF-8 /usr/bin/gnucash $@

($@ will append all parameters that are passed; and don’t forget that /usr/bin or the shell will be in an endless recursive loop calling the script over and over again which will make your system unuseable sooner or later… :wink: )
And don’t forget to make it executable:

sudo chmod +x /usr/local/bin/gnucash

Or, if you want to restrict that to one user, put that script somewhere into your home directory and create a ~/.local/share/applications/gnucash.desktop that calls this script instead of gnucash.

You can also combine this to have two different menu entries, one normal and one forced to german. Just name that script differently, and create a new .desktop file (in /usr/share/applications/ or ~/.local/share/applications/) with a different name that calls the script instead of gnucash…

You are right about the renaming. Under Gnome, the icon subscript is GnuCash, but the actual (not shown) file name is gnucash.desktop. Nautilus only shows the Properties ‘Name’ field as the icon subscript, which is not the same as file name which seems to remain almost totally inaccessible.

Well, I’m not totally against the idea to present the files that way, but there should at least be an option to show the plain files as they are with their filename. (maybe there is, but I haven’t found it yet?)
It is a file manager after all, or at least it should be…

I was getting used to Gnome, but this behaviour is making me nervous. I could never find a KDE theme that I liked. How can I change to KDE?

Just install it and you should be able to choose it at the login screen. You can have several desktops installed side-by-side without problems.
Probably the easiest way to install it is via YaST->Software Management, View->Patterns.

There is a GTK+ style for KDE (installed by default) which should allow you to use any GTK (2 I think) theme as well.

I did it! I find KDE considerably more ‘fiddly’ than Gnome and this was the reason for me to stick with Gnome until now. It took several hours to get used to it enough to set up things the way I can work with. But…Without any further action from me, KDE desktop found two separate gnucash instances, one in English and the other in German. So, in that sense anyway, problem solved.

Many thanks again, wolfi323!

…but now I am beginning to regret switching to KDE:(. I was using Yast to update packages and the KWin Manager crashed and I am now longer able to log in to KDE:O. I will need help to recover this situation and for this reason will open a new thread. :cry:

Never experienced anything like that in nearly 12 years of using KDE, and I often even “zypper dup” to a new openSUSE release inside KDE…

But even if KWin crashed, KDE would still keep on running, so you should have let finish YaST at least.

Anyway, try logging in to IceWM or similar (GNOME should still work as well). If that’s not possible because the login screen doesn’t start, login to text mode instead. Then finish the update by running “sudo zypper up” or YaST again.
You most likely have an incompatible mix of packages installed because the update was interrupted in the middle.

He only has a 12 gig root and uses BTRFS sure mix to run out of disk space. :stuck_out_tongue:

Yes, I read that.
But 12 GB is a bit on the small side even when not using BTRFS I’d say…

And I don’t think the snapshots are at fault here, his /.snapshots folder apparently “only” contains 260MB altogether.

The installer disables snapshots automatically if / is below a certain size. I don’t know that exact limit though.

PS: I just found out that setting the Exec line to this would work also in GNOME (and other DEs):

Exec=/bin/sh -c "LANGUAGE=de_DE.UTF-8 LANG=de_DE.UTF-8 gnucash %f"

(this is more conforming to the specifications)

All I can say is: in my configuration under Gnome, no matter what the command line is (if it is NOT gnucash %f) then Gnucash becomes NOT AVAILABLE as a gnome application. “You can have any colour you like as long as it is black”.

For example, I changed the command line as root to Exec=/bin/sh -c “LANGUAGE=de_DE.UTF-8 LANG=de_DE.UTF-8 gnucash %f” and Gnucash disappears from the Gnome application for the normal user.

How should GNOME know that it should be “gnucash %f”?
The entry only disappears if the desktop file is broken somehow.

For example, I changed the command line as root to Exec=/bin/sh -c “LANGUAGE=de_DE.UTF-8 LANG=de_DE.UTF-8 gnucash %f” and Gnucash disappears from the Gnome application for the normal user.

It works fine here, even in GNOME. And it should anyway.

Have you tried to logout/login?
What happens when you double-click on the file in nautilus?

Maybe you made some other mistake while editing the file?
You have to replace the existing Exec line. And make sure you save with Unix file endings.
Maybe the file permissions are wrong after you edit the file as root? The user has to be able to read the file.

And /usr/share/applications/ is overridden by ~/.local/share/applications/. So if you still have a gnucash.desktop in ~/.local/share/applications/, editing the one in /usr/share/applications will have no effect.