geany / geany

A fast and lightweight IDE
https://www.geany.org
GNU General Public License v2.0
3.12k stars 602 forks source link

Translation for status bar not being used #3620

Open scootergrisen opened 1 year ago

scootergrisen commented 1 year ago

Seems like the translation for the string in the status bar is not being using in Geany 2.0. billede

#: ../src/ui_utils.c:62
msgid ""
"line: %l / %L\t col: %c\t sel: %s\t %w      %t      %mEOL: %M      encoding: "
"%e      filetype: %f      scope: %S"
msgstr ""
"linje: %l / %L\t kolonne: %c\t markeret: %s\t %w      %t      %mlinjeafslutning: %M      kodning: "
"%e      filtype: %f      område: %S"

https://github.com/geany/geany/blob/0fd68e4182bf2540249810da52382e2f1c4810aa/src/ui_utils.c#L62-L69

Windows 7. Geany 2.0. "Pryce" (bygget Oct 19 2023 eller efter) Med afviklingsbibliotekerne GTK+ v3.24.34 og GLib v2.72.3

b4n commented 1 year ago

It works for me, but note that this is the default value for a preference, so it won't ever be updated on an existing installation. Try with geany -c /tmp/nonexistant, you should see the translation.

b4n commented 1 year ago

Hum, scratch that, doesn't seem to work for Danish…

b4n commented 1 year ago

OK no, it works fine here, I just had a stale da.gmo in my local directory, but the content of the tarball is OK. @eht16 is it possible you didn't build the Windows binaries from a fresh clone, and had a stale thing as well?

eht16 commented 1 year ago

Unfortunately, this is possible and after some testing even likely.

But this raises more questions :(. First I deleted po/da.gmo, expecting that make or make install will regenerate it. But they didn't. Instead make install raised an error:

/usr/bin/install: cannot stat './da.gmo': No such file or directory
installing ./da.gmo as /home/enrico/build/build_geany/share/locale/da/LC_MESSAGES/geany.mo

but it continued to install everything else.

After studying po/Makefile a bit, I noticed there is a target update-gmo which regenerates the *.gmo' files. This target is only indirectly byupdate-po`. This would explain why @b4n and me had some old files laying around and why we probably have distributed outdated language files on Windows already since a long time.

I wonder if this is normal behavior or something uncommon in our use.

If it is meant like this, I will update the Windows build process to enforce regenerating the gmo files (probably use a clean build clone).

@techee might be the macOS builds affected by this as well?

@scootergrisen if you want, you can try the attached geany.mo file and copy it to C:\Program Files\Geany\share\locale\da\LC_MESSAGES (or whereever you have Geany installed). geany_gmo_da.zip

eht16 commented 1 year ago

Ah funny, G-P behaves differently. There is no update-gmo target and the files seem to have been updated yesterday when building.

This reminds me of the change to autopoint (#2938) which we did not yet do for G-P and so maybe the stale *.gmo problem is rather new.

I think I will update the Geany Windows installer with the updated gmo files.

techee commented 1 year ago

@techee might be the macOS builds affected by this as well?

I used meson for Geany itself (not usre if it suffers from the same problem) and autotools for plugins. In any case I made a completely clean build from release tarballs so I hope it's alright.

eht16 commented 1 year ago

I should have done as well.

eht16 commented 1 year ago

The Geany Windows installer has been replaced with updated translation files (binaries are untouched).

@scootergrisen could you test the installer again?

scootergrisen commented 1 year ago

I downloaded and installed https://download.geany.org/geany-2.0_setup.exe again and that fixes missing translations like https://github.com/geany/geany/issues/3621 but the status bar is still partly in english.

line: %l / %L col: %c sel: %s %w %t %mEOL: %M encoding: %e filetype: %f scope: %S

b4n commented 1 year ago

@scootergrisen did you use a fresh configuration? C.f.

It works for me, but note that this is the default value for a preference, so it won't ever be updated on an existing installation. Try with geany -c /tmp/nonexistant, you should see the translation.

You should also be able to make the pref empty to use the default (it's in the various prefs)

scootergrisen commented 1 year ago

No but i tried with -c now and then i get the translated string. But does they mean that all users have to manually figure out how to get a fresh configuration when changes are made to the translation?

Then if i switch between languages like if i want to test Geany in danish and afterwards in english it seems im going to see the same string in the status bar instead of different languages. I dont think i like that. The status bar string/language should change not stay the same.

I noticed this in preferences. Maybe not a good idea to have text that are meant to be translated be part of a preference like that which is keept when the software/translation are updates and language is changed. billede

elextr commented 1 year ago

The problem with the status bar is that it is freeform text, the user can type anything in it, so there is no way to translate it.