From 74706bd9ac21e2ac2d49a3b0e0b12aa98dc94af4 Mon Sep 17 00:00:00 2001 From: hkrn <129939+hkrn@users.noreply.github.com> Date: Sat, 9 Sep 2023 19:02:56 +0900 Subject: [PATCH] [macOS] fixed a bug `Preference` menu cannot be opened (#349 and #354) (#362) The bug is caused due to macOS Ventura changes `Preferences...` to `Settings...` and renames `Preferences...` to `Settings...` internally. As a result, action cannot be fired due to menu item title changes. see https://zenn.dev/usagimaru/articles/de5012155f4916 (Japanese) --- docs/change_log.rst | 8 ++++++++ emapp/resources/translations/translations.pb | 10 ++++++---- emapp/resources/translations/translations.yml | 5 +++++ macos/classes/CocoaApplicationMenuBuilder.mm | 5 ++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/change_log.rst b/docs/change_log.rst index 17fe745c..1ea60ba9 100644 --- a/docs/change_log.rst +++ b/docs/change_log.rst @@ -5,6 +5,14 @@ .. note:: 31.5.0 以前の変更履歴は :doc:`change_log_past` を参照してください +34.10.0 (2023/9/9) +****************************************** + +不具合修正 +========================================== + +* 言語設定が英語かつ macOS Ventura 以降の場合において設定が開けない + 34.9.0 (2023/4/2) ****************************************** diff --git a/emapp/resources/translations/translations.pb b/emapp/resources/translations/translations.pb index 6527c9c6..adeb1681 100644 --- a/emapp/resources/translations/translations.pb +++ b/emapp/resources/translations/translations.pb @@ -1,5 +1,5 @@ -@ +@ nanoem.gui.unimplemented$未実装のため現在利用不可 nanoem.gui.camera カメラ% nanoem.gui.keyframe.copy コピー' @@ -953,7 +953,8 @@ $nanoem.menu.accessory.enable.visible表示を有効にする(&V)+ 'nanoem.menu.edit.morph.reset-all-morphs!全てのモーフをリセット[ *nanoem.menu.edit.morph.register-all-morphs-全てのモーフをキーフレーム登録. nanoem.menu.macos.aboutnanoem について* -nanoem.menu.macos.preferences 設定...* +nanoem.menu.macos.preferences 設定...' +nanoem.menu.macos.settings 設定...* nanoem.menu.macos.hidenanoem を隠す- nanoem.menu.macos.hide-allほかを隠す- nanoem.menu.macos.show-allすべて表示* @@ -1181,7 +1182,7 @@ Ananoem.status.ERROR_DOCUMENT_MODEL_OUTSIDE_PARENT_STATE_NOT_FOUND3モーフの ;nanoem.status.ERROR_DOCUMENT_MODEL_OUTSIDE_PARENT_CORRUPTED-モデルの外部親が破損していますl 2nanoem.status.ERROR_DOCUMENT_SELF_SHADOW_CORRUPTED6セルフシャドウデータが破損しています ;nanoem.status.ERROR_DOCUMENT_SELF_SHADOW_KEYFRAME_CORRUPTEDBセルフシャドウのキーフレームが破損しています -F +F nanoem.gui.unimplemented*Currently Unavailable due to unimplemented nanoem.gui.cameraCamera nanoem.gui.keyframe.copyCopy @@ -2155,7 +2156,8 @@ Fullscreen# 'nanoem.menu.edit.morph.reset-all-morphsReset All MorphsJ *nanoem.menu.edit.morph.register-all-morphsRegister All Morph Keyframes' nanoem.menu.macos.about About nanoem/ -nanoem.menu.macos.preferencesPreferences...% +nanoem.menu.macos.preferencesPreferences...) +nanoem.menu.macos.settings Settings...% nanoem.menu.macos.hide Hide nanoem) nanoem.menu.macos.hide-all Hide Others& nanoem.menu.macos.show-allShow All% diff --git a/emapp/resources/translations/translations.yml b/emapp/resources/translations/translations.yml index c8dd3b24..a55e2ef2 100644 --- a/emapp/resources/translations/translations.yml +++ b/emapp/resources/translations/translations.yml @@ -4023,6 +4023,11 @@ en_US: 'Preferences...' ja_JP: '設定...' description: '' +- key: nanoem.menu.macos.settings + phrase: + en_US: 'Settings...' + ja_JP: '設定...' + description: '' - key: nanoem.menu.macos.hide phrase: en_US: 'Hide nanoem' diff --git a/macos/classes/CocoaApplicationMenuBuilder.mm b/macos/classes/CocoaApplicationMenuBuilder.mm index 6678b33b..81977349 100644 --- a/macos/classes/CocoaApplicationMenuBuilder.mm +++ b/macos/classes/CocoaApplicationMenuBuilder.mm @@ -461,8 +461,11 @@ [app orderFrontStandardAboutPanel:app]; }]; [m_appMenu addSeparator]; + NSString *settingsTitle = NSAppKitVersionNumber > NSAppKitVersionNumber12_5 + ? translatedString("nanoem.menu.macos.settings") + : translatedString("nanoem.menu.macos.preferences"); NSMenuItem *preferenceMenuItem = - [m_appMenu addItemWithTitle:translatedString("nanoem.menu.macos.preferences") + [m_appMenu addItemWithTitle:settingsTitle action:^() { m_client->sendMenuActionMessage(kMenuItemTypeEditPreference); }