After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794073 - French (and probably other) translation issue with default "about" menu
French (and probably other) translation issue with default "about" menu
Status: RESOLVED FIXED
Product: gtk-mac-integration
Classification: Other
Component: General
unspecified
Other Mac OS
: Normal enhancement
: ---
Assigned To: GTK Mac Integration Maintainers
GTK Mac Integration Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-05 09:09 UTC by cyril
Modified: 2019-02-22 05:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description cyril 2018-03-05 09:09:54 UTC
When using gtkosx_application_insert_app_menu_item at index=0, the app name is appended.
So when using the default gtk_menu_image "about" widget, we obtain, for example with GIMP, something like:
About GIMP
This is correct in english but not in other languages.
For example in French we have
À propos GIMP
while we expect
À propos de GIMP
Comment 1 John Ralls 2018-03-05 15:26:29 UTC
Sorry, that's not part of Gtkosxapplication's localization, it's MacOS's. There's nothing we can do about it. You're welcome to file a bug with Apple, but I wouldn't expect any response.
Comment 2 Piotr Drąg 2018-03-05 18:32:03 UTC
FWIW, GTK+ 3 has that string and it has been translated as “À propos de %s” in French: https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/po/fr.po#L1515

So it’s possible that it will be fixed when GIMP moves to GTK+ 3.
Comment 3 cyril 2018-03-05 19:56:46 UTC
Oh ok.
I also use it for my GTK+ 3 application and I have the same issue. But if it's part of MacOS ... it will be complicated.

Thanks
Comment 4 John Ralls 2018-03-05 23:22:24 UTC
(In reply to Piotr Drąg from comment #2)
> FWIW, GTK+ 3 has that string and it has been translated as “À propos de %s”
> in French: https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/po/fr.po#L1515
> 
> So it’s possible that it will be fixed when GIMP moves to GTK+ 3.

I looked through my code and indeed, I was mistaken about where the "About GIMP" comes from and where it's translated. It gets the translated string from the Gtk menu item which has traditionally been Help>About and it appends the application name retrieved from either Info.plist if it's a bundle or argv[0] if not (by way of [NSFileManager displayNameAtPath: exepath]).

If GIMP is changing their "Help>About" menu item to "Help>About GIMP" then I'll need to change the code so that it doesn't do the addition if the label already ends with the executable name; otherwise on Macs the menu item will be "About GIMP GIMP".
Comment 5 Piotr Drąg 2018-03-05 23:30:08 UTC
That sort of concatenation is a bad idea from a localization point of view. Many languages may have to change the translation of “About” depending on what is next in the label, and the whole thing falls apart for languages other than subject-verb-object languages.
Comment 6 John Ralls 2018-03-05 23:49:50 UTC
I agree. I was trying to make it easy for people to port to Mac without having to provide a custom string and get it translated in their own po files but to still have the Mac-standard "About GIMP" instead of just "About", but I needed to also handle the possibility that someone would try to stuff some other item there.

In retrospect I think it was also incorrect to try to use Apple's native localization for those menu items since everything else in a project will be in gettext.

I suppose another way to handle it would be to just create an _("About %s") menu item for the first item and have it call gtk_show_about_dialog(). That forces the about menu item to be Mac-standard. It's less flexible but that's probably not a real problem.
Comment 7 cyril 2018-03-06 09:06:53 UTC
(In reply to John Ralls from comment #6)

> I suppose another way to handle it would be to just create an _("About %s")
> menu item for the first item and have it call gtk_show_about_dialog(). That
> forces the about menu item to be Mac-standard. It's less flexible but that's
> probably not a real problem.

For sure, it would fix the issue.
Comment 8 Piotr Drąg 2018-03-06 17:15:04 UTC
(In reply to John Ralls from comment #6)
> I suppose another way to handle it would be to just create an _("About %s")
> menu item for the first item and have it call gtk_show_about_dialog(). That
> forces the about menu item to be Mac-standard. It's less flexible but that's
> probably not a real problem.

I thought this is what https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/gtk/ui/gtkapplication-quartz.ui#L7 is for?
Comment 9 John Ralls 2018-03-06 17:33:00 UTC
(In reply to Piotr Drąg from comment #8)
 
> I thought this is what
> https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/gtk/ui/gtkapplication-
> quartz.ui#L7 is for?

Don't get confused between gtkapplication and gtkosxapplication. This is about the latter. They're neither interchangeable nor interoperable.
Comment 10 cyril 2018-03-09 08:49:10 UTC
(In reply to John Ralls from comment #6)

> I suppose another way to handle it would be to just create an _("About %s")
> menu item for the first item and have it call gtk_show_about_dialog(). That
> forces the about menu item to be Mac-standard. It's less flexible but that's
> probably not a real problem.

Hello, so do you think you will officially work on a fix ?
Cheers,
Comment 11 John Ralls 2018-03-09 15:22:31 UTC
Yes, but I won't have time for a few weeks. If you (or anyone else) like to work up a patch and attach it that will speed up the process. It should just create the About menu item in create_apple_menu and the 'if (index == 0)' block should just hide the item passed to it. Change the comment about a sleazy hack to explain that item 0 is the About item and that we're hiding the item passed to it for backwards compatibility. The docs should explain that and that one can simply hide the item in their regular menu if  they'd rather. The several GtkosxApplication.strings.* will need a new translation for "About %s".

Step 2 is to replace all of Gtkosxapplication.strings.* with corresponding .po files, changing the directory from strings to po, replacing the cocoa localization calls with gettext ones, and adjusting the build system to require and invoke gettext.
Comment 12 cyril 2018-03-24 13:57:14 UTC
Sorry, busy weeks to.
First step looks easye.
Second one ....

It is probably better that you do it. No rush.
Comment 13 John Ralls 2018-05-12 20:48:51 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Comment 14 cyril 2018-05-25 12:48:16 UTC
Thank you so much !!!
I'm running on testing, so I will wait. You did a great job !!