diff --git a/.gitignore b/.gitignore index 13c9cab..43b1985 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build *.dmg *.tar.bz2 +.cache diff --git a/dmg/Base.lproj b/dmg/Base.lproj new file mode 120000 index 0000000..545e7ac --- /dev/null +++ b/dmg/Base.lproj @@ -0,0 +1 @@ +en.lproj \ No newline at end of file diff --git a/dmg/CMakeLists.txt b/dmg/CMakeLists.txt index e4dbe6b..08e2a5d 100644 --- a/dmg/CMakeLists.txt +++ b/dmg/CMakeLists.txt @@ -2,6 +2,18 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/fcitx.icns" DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" ) +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Base.lproj" + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" +) + install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/en.lproj" DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" ) + +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/zh-Hans.lproj" + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" +) + +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/zh-Hant.lproj" + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" +) diff --git a/dmg/zh-Hans.lproj/InfoPlist.strings b/dmg/zh-Hans.lproj/InfoPlist.strings new file mode 100644 index 0000000..718c540 --- /dev/null +++ b/dmg/zh-Hans.lproj/InfoPlist.strings @@ -0,0 +1,3 @@ +CFBundleName = "小企鹅"; +CFBundleDisplayName = "小企鹅"; +org.fcitx.inputmethod.fcitx5 = "小企鹅"; diff --git a/dmg/zh-Hant.lproj/InfoPlist.strings b/dmg/zh-Hant.lproj/InfoPlist.strings new file mode 100644 index 0000000..9ed31e5 --- /dev/null +++ b/dmg/zh-Hant.lproj/InfoPlist.strings @@ -0,0 +1,3 @@ +CFBundleName = "小企鵝"; +CFBundleDisplayName = "小企鵝"; +org.fcitx.inputmethod.fcitx5 = "小企鵝"; diff --git a/src/config/menu.swift b/src/config/menu.swift index ecde088..5a7f8df 100644 --- a/src/config/menu.swift +++ b/src/config/menu.swift @@ -1,7 +1,12 @@ -import Foundation +import Cocoa extension FcitxInputController { + static var fcitxAbout: NSWindowController? + @objc func about(_: Any? = nil) { - FcitxAbout().showWindow(nil) + if FcitxInputController.fcitxAbout == nil { + FcitxInputController.fcitxAbout = FcitxAbout() + } + FcitxInputController.fcitxAbout!.showWindow(nil) } }