mhoeher / opentodolist

A simple Todo and task management application - Mirror of https://gitlab.com/rpdev/opentodolist
https://opentodolist.rpdev.net
GNU General Public License v3.0
161 stars 12 forks source link

macOS: Activate localization for Qt's macOS-specific Finder menu #55

Closed HackintoshHD closed 2 years ago

HackintoshHD commented 2 years ago

I've joined the localization efforts for OpenTodoList on POEditor a while ago and have noticed that the Qt's macOS-specific Finder menu is not localizable (by that 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). All content remains in English which would be okay if the strings simply hadn't been translated yet.

I've initially noticed this issue in another of my favorite applications, digiKam, which is also built on Qt and have filed a bug report there. Gilles Caulier, digikam's coordinator and one of its three lead developers, has looked into the issue and could resolve it really easily for digiKam:

https://bugs.kde.org/show_bug.cgi?id=432685#c3 https://bugs.kde.org/show_bug.cgi?id=432685#c4

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. So I wonder if the described folder structure could be added to one of OpenTodoList's next builds?

Thanks a lot!

mhoeher commented 2 years ago

Hi @HackintoshHD,

thanks a lot for reporting this issue (and of course for participating in the translation process)! The details you provided should help to implement this quite easily. I'll try to get this into the next release (which I planned to push out the next days).

For your reference, here is the internal tracking issue over on GitLab: https://gitlab.com/rpdev/opentodolist/-/issues/479

I'll notify you once there's something to test :wink:

HackintoshHD commented 2 years ago

Thank you very much (… and I'll definitely revive my gitlab.com account 😃 )!

mhoeher commented 2 years ago

Hi @HackintoshHD,

as promised, I tried to implement a fix as suggested in the issue you linked to. Here is a build for that: https://gitlab.com/rpdev/opentodolist/-/jobs/1656278539/artifacts/file/build-macos/app/OpenTodoList.dmg

Would be great if you could give it a shot and see if it works as expected for you. Thanks :wink:

HackintoshHD commented 2 years ago

That was fast, thank you!

Unfortunately, the changes did not have the expected result yet - the Qt Finder menu is still in English (while using German as the macOS system locale):

OpenTodoList 3.37.2-custom

The .lproj folders in …/MacOS/Resources are visible, though:

MyUserName@MacBook Pro:/Applications/OpenTodoList.app/Contents/Resources $ ls -al
total 536
drwxr-xr-x@ 38 MyUserName  admin    1292  6 Okt 23:01 .
drwxr-xr-x@  9 MyUserName  admin     306  6 Okt 23:01 ..
-rw-r--r--@  1 MyUserName  admin  269232  6 Okt 23:01 OpenTodoList.icns
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 af.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 br.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 ca.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 da.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 de.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 el.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 en.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 es.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 es_419.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 eu.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 fi.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 fil.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 fr.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 hu.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 it.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 ja.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 ka.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 ko.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 nl.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 no.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 pl.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 pt.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 pt_br.lproj
drwxr-xr-x@  7 MyUserName  admin     238  6 Okt 23:01 qml
-rw-r--r--@  1 MyUserName  admin      78  6 Okt 23:01 qt.conf
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 ru.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 sk.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 sl.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 sv.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 tk.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 tr.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 uk.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 vi.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 zh_CN.lproj
drwxr-xr-x@  2 MyUserName  admin      68  6 Okt 23:01 zh_Hans.lproj

MyUserName@MacBook Pro:/Applications/OpenTodoList.app/Contents/Resources $

I think I'll go through Gilles' comments on Qt's localization features again later today, maybe I missed some detail. - Anyway, thanks again for addressing this request so fast!

mhoeher commented 2 years ago

Hm... too bad :disappointed: I'll also check if I can find something.

mhoeher commented 2 years ago

Hi @HackintoshHD,

some good morning news: After spending yesterday evening without finding a solution, I had an idea that morning and - voila - here you go: https://gitlab.com/rpdev/opentodolist/-/jobs/1678372031/artifacts/file/build-macos/app/OpenTodoList.dmg

The trick (just in case someone else ever runs into the same situation):

As OpenTodoList uses QML for its GUI, I never created a menu within the app. The application menu shown on macOS hence seems to be generated by the OS or Qt on its own. However, to enable translation of that menu, I had to simply create an otherwise empty QMenuBar - that did the trick.

Please give the new build a try.

By the way: I actually also found the cause for another issue. Probably you also already ran into this - on macOS (and maybe other systems as well), the system language was not detected properly, so one had to manually select the app language in the settings. This should be fixed as well with this build :wink:

mhoeher commented 2 years ago

Mep... seems I was too quick... My fix from this morning caused the app to show up a translated menu from within the IDE, but not from the readily built App Bundle.

I spent some more time and now hopefully have a working version. Please find it here: https://gitlab.com/rpdev/opentodolist/-/jobs/1681612412/artifacts/file/build-macos/app/OpenTodoList.dmg

HackintoshHD commented 2 years ago

Thank you very much. I can confirm the Qt Finder menu is now localized and - yes - I also had experienced the other issue with the broken language detection when the selection was on "System Language", which I already had used the workaround of selecting "German" manually for.

Both issues are fixed now in the build you've provided above:

OpenTodoList with German Qt menu

Thanks again for your responsiveness on such issues, it's always a pleasure to report something and so see it getting fixed so fast!

mhoeher commented 2 years ago

Thanks a lot for confirming! :partying_face:

I'll go ahead and merge the change then and try to push out a new release later this evening (or latest the weekend).