GNOME Bugzilla – Bug 794073
French (and probably other) translation issue with default "about" menu
Last modified: 2019-02-22 05:14:19 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
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.
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.
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
(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".
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.
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.
(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.
(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?
(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.
(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,
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.
Sorry, busy weeks to. First step looks easye. Second one .... It is probably better that you do it. No rush.
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.
Thank you so much !!! I'm running on testing, so I will wait. You did a great job !!