File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,19 +9,31 @@ public func openURL(_ urlString: String) {
99 }
1010}
1111
12+ public struct KeyboardInfo {
13+ public let id : String
14+ public let displayName : String
15+ }
16+
1217public func listKeyboards( ) -> [ String ] {
18+ listKeyboardInfo ( ) . map { $0. id }
19+ }
20+
21+ public func listKeyboardInfo( ) -> [ KeyboardInfo ] {
1322 let pluginsURL = appBundleUrl. appendingPathComponent ( " PlugIns " )
14- var result = [ String ] ( )
23+ var result = [ KeyboardInfo ] ( )
1524 if let items = try ? FileManager . default. contentsOfDirectory (
1625 at: pluginsURL,
1726 includingPropertiesForKeys: nil ,
1827 options: [ . skipsHiddenFiles] )
1928 {
2029 for item in items where item. pathExtension == " appex " {
21- result. append ( item. deletingPathExtension ( ) . lastPathComponent)
30+ let id = item. deletingPathExtension ( ) . lastPathComponent
31+ let displayName =
32+ Bundle ( url: item) ? . object ( forInfoDictionaryKey: " CFBundleDisplayName " ) as? String ?? id
33+ result. append ( KeyboardInfo ( id: id, displayName: displayName) )
2234 }
2335 }
24- return result
36+ return result. sorted { $0 . id < $1 . id }
2537}
2638
2739public func requestReload( ) {
Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ if (HALLELUJAH)
118118 # copy_to(Hallelujah copy "${HALLELUJAH_SOURCE_DIR}/data/cedict.json" "share/hallelujah/cedict.json")
119119 copy_to (Hallelujah copy "${HALLELUJAH_BINARY_DIR } /src/hallelujah-addon.conf" "${ADDON_PREFIX} /hallelujah.conf" )
120120 copy_to (Hallelujah copy "${HALLELUJAH_BINARY_DIR } /src/hallelujah.conf" "${IM_PREFIX} /hallelujah.conf" )
121+
122+ install_cxx_translations ("engines/fcitx5-hallelujah/po" )
121123endif ()
122124
123125if (MOZC)
You can’t perform that action at this time.
0 commit comments