Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build

# Auto-generated data
assets/en.lproj/Localizable.strings
assets/po/base.pot
*.pot
meta.swift
*~
version.json
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ add_subdirectory(fcitx5-beast/src)

add_subdirectory(src)
add_subdirectory(assets)
add_subdirectory(po)

enable_testing()
add_subdirectory(tests)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ English

[Fcitx5](https://github.com/fcitx/fcitx5) input method framework ported to macOS.

Please download [installer](https://github.com/fcitx-contrib/fcitx5-macos-installer).
Please download [installer](https://github.com/fcitx-contrib/fcitx5-macos-installer) and read [documentation](https://fcitx-contrib.github.io/docs/).

## Build
Native build on Intel and Apple Silicon is supported.

This is NOT an Xcode project,
but Xcode is needed for Swift compiler.
but Xcode >= 26 is needed for Swift compiler.

### Install dependencies
You may use [nvm](https://github.com/nvm-sh/nvm)
Expand Down Expand Up @@ -98,14 +98,14 @@ cmake --build build/$(uname -m) --target pot

To add a new language, do
```sh
cd assets/po && msginit -l <locale>
cd po && msginit -l <locale>
```

Then, use a PO file editor to translate strings.

Finally, to merge new strings into PO files, do
```sh
cd assets/po && msgmerge -U <locale>.po base.pot
cd po && msgmerge -U <locale>.po base.pot
```

## Credits
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

[Fcitx5](https://github.com/fcitx/fcitx5) 输入框架的 macOS 移植。

请下载[安装器](https://github.com/fcitx-contrib/fcitx5-macos-installer/blob/master/README.zh-CN.md)
请下载[安装器](https://github.com/fcitx-contrib/fcitx5-macos-installer/blob/master/README.zh-CN.md)并阅读[文档](https://fcitx-contrib.github.io/docs/)
2 changes: 0 additions & 2 deletions assets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,3 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Base.lproj"
foreach(LPROJ_DIR IN LISTS LPROJ_DIRS)
install(DIRECTORY "${LPROJ_DIR}" DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources")
endforeach()

add_subdirectory(po)
6 changes: 6 additions & 0 deletions assets/po/CMakeLists.txt → po/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ set(TRANSLATABLE_CXX_SOURCES
webpanel/webpanel.h
)

set(TRANSLATABLE_CONFIG_SOURCES
macosfrontend/macosfrontend.conf.in.in
macosnotifications/notifications.conf.in.in
)

list(TRANSFORM TRANSLATABLE_CXX_SOURCES PREPEND "${PROJECT_SOURCE_DIR}/" OUTPUT_VARIABLE TRANSLATABLE_CXX_SOURCES_FULL_PATH)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/base.pot
COMMAND xgettext --c++ --keyword=_ --keyword=N_ ${TRANSLATABLE_CXX_SOURCES} -o ${CMAKE_CURRENT_SOURCE_DIR}/base.pot
COMMAND xgettext --language=Desktop ${TRANSLATABLE_CONFIG_SOURCES} -j -o ${CMAKE_CURRENT_SOURCE_DIR}/base.pot
DEPENDS ${TRANSLATABLE_CXX_SOURCES_FULL_PATH}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating base.pot..."
Expand Down
2 changes: 2 additions & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zh_CN
zh_TW
8 changes: 8 additions & 0 deletions assets/po/zh_CN.po → po/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -555,3 +555,11 @@ msgstr "尺寸"
#: webpanel/webpanel.h:396
msgid "Advanced"
msgstr "高级"

#: macosfrontend/macosfrontend.conf.in.in:2
msgid "macOS Frontend"
msgstr "macOS 前端"

#: macosnotifications/notifications.conf.in.in:2
msgid "macOS Notification"
msgstr "macOS 通知"
8 changes: 8 additions & 0 deletions assets/po/zh_TW.po → po/zh_TW.po
Original file line number Diff line number Diff line change
Expand Up @@ -555,3 +555,11 @@ msgstr "尺寸"
#: webpanel/webpanel.h:396
msgid "Advanced"
msgstr "進階"

#: macosfrontend/macosfrontend.conf.in.in:2
msgid "macOS Frontend"
msgstr "macOS 前端"

#: macosnotifications/notifications.conf.in.in:2
msgid "macOS Notification"
msgstr "macOS 通知"
Loading