Bug 432685 - macOS: Krita Finder menu item not localized/localizable despite non-English system locale
Summary: macOS: Krita Finder menu item not localized/localizable despite non-English s...
Status: ASSIGNED
Alias: None
Product: krita
Classification: Applications
Component: Translation (show other bugs)
Version: 4.4.2
Platform: Other macOS
: NOR minor
Target Milestone: ---
Assignee: vanyossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-09 12:36 UTC by Hackintosh HD
Modified: 2023-06-10 07:18 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of non-localized/localizable Krita macOS Finder menu item (30.75 KB, image/png)
2021-02-09 12:36 UTC, Hackintosh HD
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hackintosh HD 2021-02-09 12:36:49 UTC
Created attachment 135531 [details]
Screenshot of non-localized/localizable Krita macOS Finder menu item

I'm using Krita on macOS with a German system locale. While I'm getting Krita's menus displayed in German as expected, the Krita macOS Finder menu item still does appear in U.S. English (by 'Krita macOS Finder menu item' I refer to the Mac-specific, first menu item and its sub-entries in the macOS Finder bar on top of the screen right to the Apple symbol, which for macOS applications is always the application's name, cf. the attached screenshot).

To my understanding, this would be normal if the strings simply hadn't been translated yet. There however is a similarity to the digikam project insofar as their macOS build shows the same behavior and it remains unclear how to localize this macOS-specific menu. I've reported the issue as https://bugs.kde.org/show_bug.cgi?id=432650 and would like to raise it here, too, as Krita shows the same behavior. It sure is a more or less cosmetic issue, but on the other hand, a homogeneous, complete localization very much adds to an 'OS-native' user experience of an application.


STEPS TO REPRODUCE
1. Launch Krita 4.4.2 (and probably all earlier versions) under macOS
2. Check the Krita Finder menu item with an active localization

SOFTWARE/OS VERSIONS
macOS: 10.14.6 Security Update 2021-001
Comment 1 amyspark 2021-02-09 12:49:15 UTC
Can confirm with a build from master and the system locale set to Spanish. Even with Krita's locale manually set to Spanish, its system menu still renders in English.

macOS: 10.14.6 Security Update 2021-001 as well.
Comment 3 caulier.gilles 2021-06-13 14:31:17 UTC
Alvin,

from this page: https://plashless.wordpress.com/2014/07/16/localizing-a-pyqt-app-on-macos-osx/

"The file locversion.plist does not seem to be necessary anymore (on OSX 10.9 and Qt5) to get a Qt app to be localized (despite what certain Qt documentation says.)

OSX knows what translations your Qt app supports only by the set of xx.lproj folders in the Resources folder of your app bundle.  For a Qt app, these xx.lproj folders will contain little if anything, just a placeholder, say a single Localizable.string, which really is not used by your app.  By “OSX knows” I mean: OSX translates native dialog strings according to.  Much of your GUI is from Qt, and is translated by Qt, but Qt displays some native dialogs (provided by OSX) and these are localized by OSX according to the presence of the xx.lproj files."

If i look to my macbook pro install of VirtualBox (Qt based GUI), i can see :

bash-3.2$ pwd
/Applications/VirtualBox.app/Contents/Resources
bash-3.2$ ls -al
total 4384
drwxr-xr-x  43 root  admin    1376 28 avr 19:21 .
drwxr-xr-x   9 root  admin     288 28 avr 19:21 ..
-rw-r--r--   1 root  admin   20137 28 avr 19:00 LICENSE
drwxr-xr-x   3 root  admin      96  2 mai 05:07 VirtualBoxVM.app
drwxr-xr-x   2 root  admin      64 28 avr 19:00 bg.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 ca.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 cs.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 da.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 de.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 el.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 en.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 es.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 eu.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 fa.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 fr.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 hr_HR.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 hu.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 id.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 it.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 ja.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 ko.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 lt.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 nl.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 pl.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 pt_BR.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 ru.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 sl.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 th.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 tr.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 uk.lproj
-rw-r--r--   1 root  admin  227127 28 avr 19:00 virtualbox-hdd.icns
-rw-r--r--   1 root  admin  241607 28 avr 19:00 virtualbox-ova.icns
-rw-r--r--   1 root  admin  241964 28 avr 19:00 virtualbox-ovf.icns
-rw-r--r--   1 root  admin  235145 28 avr 19:00 virtualbox-vbox-extpack.icns
-rw-r--r--   1 root  admin  245074 28 avr 19:00 virtualbox-vbox.icns
-rw-r--r--   1 root  admin  237080 28 avr 19:00 virtualbox-vdi.icns
-rw-r--r--   1 root  admin  214372 28 avr 19:00 virtualbox-vhd.icns
-rw-r--r--   1 root  admin  226107 28 avr 19:00 virtualbox-vmdk.icns
-rw-r--r--   1 root  admin  312039 28 avr 19:00 virtualbox.icns
-rw-r--r--   1 root  admin   21701 28 avr 19:00 virtualbox.png
drwxr-xr-x   3 root  admin      96  2 mai 05:07 vmstarter.app
drwxr-xr-x   2 root  admin      64 28 avr 19:00 zh_CN.lproj
drwxr-xr-x   2 root  admin      64 28 avr 19:00 zh_TW.lproj
bash-3.2$ 

All xx.jproj are empty directories.

Best

Gilles Caulier
Comment 4 caulier.gilles 2021-06-13 14:36:51 UTC
If i create an empty directory named fr.lproj in my digiKam bundle installation:

# pwd
/Applications/digiKam.org/digikam.app/Contents/Resources
# ls -al
total 17328
drwxr-xr-x  31 root  wheel      992 13 jui 16:33 .
drwxr-xr-x  10 root  wheel      320 13 jui 08:15 ..
-rw-r--r--   1 root  wheel    56198 27 fév 01:23 Marble.icns
drwxr-xr-x   4 root  wheel      128 13 jui 08:15 applications
-rw-r--r--   1 root  wheel  7710080 13 jui 00:24 breeze-dark.rcc
-rw-r--r--   1 root  wheel  8622858 13 jui 00:24 breeze.rcc
drwxr-xr-x  23 root  wheel      736 13 jui 08:15 data
drwxr-xr-x  13 root  wheel      416 30 déc 07:21 digikam
-rw-r--r--   1 root  wheel   212575 12 jui 23:36 digikam_SRCS.icns
drwxr-xr-x   2 root  admin       64 28 avr 19:00 fr.lproj
-rw-r--r--   1 root  wheel   188771 27 fév 01:23 gpx.icns
drwxr-xr-x   3 root  wheel       96  7 jan 18:16 icons
-rw-r--r--   1 root  wheel   190753 27 fév 01:23 json.icns
drwxr-xr-x   5 root  wheel      160 29 déc 20:53 kf5
-rw-r--r--   1 root  wheel   186629 27 fév 01:23 kml.icns
drwxr-xr-x   3 root  wheel       96 13 jui 08:15 knotifications5
drwxr-xr-x   4 root  wheel      128 13 jui 08:15 kservices5
drwxr-xr-x   4 root  wheel      128 13 jui 08:15 kservicetypes5
drwxr-xr-x   4 root  wheel      128 30 déc 07:21 kxmlgui5
drwxr-xr-x   4 root  wheel      128 30 déc 06:45 lensfun
drwxr-xr-x  58 root  wheel     1856 31 mar 07:59 locale
-rw-r--r--   1 root  wheel   188135 27 fév 01:23 log.icns
drwxr-xr-x  27 root  wheel      864 13 jui 08:15 mime
drwxr-xr-x   6 root  wheel      192 13 jui 08:15 opencv4
-rw-r--r--   1 root  wheel   190352 27 fév 01:23 osm.icns
drwxr-xr-x  60 root  wheel     1920 13 jui 08:15 plugins
-rw-r--r--   1 root  wheel   186980 27 fév 01:23 pn2.icns
-rw-r--r--   1 root  wheel   185111 27 fév 01:23 pnt.icns
drwxr-xr-x   3 root  wheel       96 30 déc 07:21 showfoto
-rw-r--r--   1 root  wheel   212397 12 jui 23:54 showfoto_SRCS.icns
drwxr-xr-x   3 root  wheel       96 30 déc 07:21 solid

... and if i switch digiKam from EN to FR, after restarting application i can see MacOS menu entries translated to French...

Gilles Caulier
Comment 5 Halla Rempt 2022-09-20 13:57:31 UTC
So, basically, as part of the build script we should take Resources/locale, and for every locale in there create an empty folder with .lproj?
Comment 6 amyspark 2022-09-20 13:58:37 UTC
Correct. I believe that entries should also be added to Info.plist, but I don't recall the specifics for that one.
Comment 7 caulier.gilles 2022-09-20 14:00:54 UTC
For digiKam, we do that :

https://invent.kde.org/graphics/digikam/-/blob/master/project/bundles/macports/04-build-installer.sh#L323

... and it work as expected.

Gilles Caulier
Comment 8 Halla Rempt 2022-09-20 14:02:34 UTC
Well, I guess ivan can just copy that then :-)
Comment 9 vanyossi 2022-09-22 05:58:31 UTC
I remember trying this before, but never dig enough to come with a proper fix. On my system at least the empty .lproj folders on krita does nothing, however the folder for each location is required so I might as well start with that :).

locversion.plist do work to change "krita" to "crayola" when I select spanish, however the other menu entries remain in english.
Comment 10 vanyossi 2022-09-22 05:59:39 UTC
Git commit ab9b603ff4bd3b13fd47e525c8a47c59df39d8f8 by Ivan Yossi.
Committed on 22/09/2022 at 05:59.
Pushed by ivany into branch 'master'.

Attempt to fix missing localization on macOS app menu

M  +10   -0    packaging/macos/osxdeploy.sh

https://invent.kde.org/graphics/krita/commit/ab9b603ff4bd3b13fd47e525c8a47c59df39d8f8
Comment 11 Halla Rempt 2022-09-22 08:54:20 UTC
Maybe the difference is that we're using an older version of Qt that doesn't work with the empy lproj folder hack?
Comment 12 vanyossi 2023-06-10 07:18:57 UTC
Git commit fcc0b6e09245d133d2c1efd36b0afb9a7cf543f2 by Ivan Yossi.
Committed on 10/06/2023 at 07:18.
Pushed by ivany into branch 'master'.

add empty lproj dirs to try and fix bug 432685

M  +8    -8    packaging/macos/osxdeploy.sh

https://invent.kde.org/graphics/krita/-/commit/fcc0b6e09245d133d2c1efd36b0afb9a7cf543f2