Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduces input macros #97

Merged
merged 8 commits into from
Dec 12, 2023
Merged

Introduces input macros #97

merged 8 commits into from
Dec 12, 2023

Conversation

zonble
Copy link
Collaborator

@zonble zonble commented Dec 11, 2023

The PR introduces input macros. Input macros are candidates that would be
replace dynamically by the input engine. We use input macros to input date and
time since a user might be hardly to remember the current date (especially in
the traditional Chinese calendar such as 癸卯年).

Currently, it supports the following input macros:

輸入 範例
今天日期 2023 年 12 月 11 日
明天日期 民國 112 年 12 月 12 日
現在時間 下午 2:28:21
所在時區 台北標準時間
今年干支 癸卯年
今年生肖 水兔年

The localized dates are powered by ICU, so ICE becomes a dependency.

@zonble zonble requested a review from lukhnos December 11, 2023 06:36
Copy link
Collaborator

@lukhnos lukhnos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to cherry-pick 40f78ba , which uses an std::unordered_map for the macro lookup?

Otherwise LGTM!

README.md Outdated
@@ -35,6 +35,12 @@ sudo apt install \
cmake extra-cmake-modules gettext libfmt-dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should we just add libicu-dev here? Since we are already telling people they need to install those -dev packages here…

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated at 84b0dc5

@zonble
Copy link
Collaborator Author

zonble commented Dec 12, 2023

Would you like to cherry-pick 40f78ba , which uses an std::unordered_map for the macro lookup?

Otherwise LGTM!

The branch was merged.

@zonble zonble requested a review from lukhnos December 12, 2023 15:06
@lukhnos lukhnos merged commit 3fc9499 into openvanilla:master Dec 12, 2023
3 checks passed
@@ -4,5 +4,5 @@ rm -rf build
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug # use Debug for easy debugging with gdb
make # or ninja, depending on your system
sudo make install # or sudo ninja install
make # or ninja, depending on your system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: to use ninja we need to add -G Ninja in cmake command. @lukhnos would you like to create a small PR for this?

#96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants