πΊπΈ English | π¨π³ δΈζη
A modular Telegram bot framework for C++ developers.
This project is a Telegram bot framework designed for C++ developers, aimed at simplifying the complexities of bot development. By leveraging a highly modular plugin system, you no longer need to worry about low-level network communication or API interactions. Simply focus on developing plugins for your desired features, and you can quickly build powerful and extensible Telegram bots.
- Language Internationalization
- Terminal User Interface (under development)
- Network Communication
- Plugin system
This project uses the gettext toolchain for internationalization (i18n) and localization (l10n).
This step scans the source code and extracts all translatable strings into a .pot (Portable Object Template) file.
-
Option 1: Specify files manually
xgettext --language=C++ --from-code=UTF-8 -o [path/to/output.pot] --keyword=translate [source_file_1] [source_file_2] ...
- Example:
xgettext --language=C++ --from-code=UTF-8 -o Language/StyxTelegramBotFramework.pot --keyword=translate Src/Main.CPP Src/Core/System/SingletonInstanceControl.CPP
- Example:
-
Option 2: Find all source files automatically (Recommended) This command automatically finds all
.CPPand.HPPfiles within theSrcandIncludedirectories.find Src Include -name "*.CPP" -o -name "*.HPP" | xargs xgettext --language=C++ --from-code=UTF-8 -o Language/StyxTelegramBotFramework.pot --keyword=translate
Based on the .pot template, create a new .po file for a target language (e.g., Simplified Chinese zh_CN). This file will contain the actual translations.
- Command:
msginit --input=[path/to/template.pot] --locale=[language_code] -o [path/to/output.po]
- Example:
After creating the file, you need to edit this
msginit --input=Language/StyxTelegramBotFramework.pot --locale=zh_CN -o Language/zh_CN/LC_MESSAGES/StyxTelegramBotFramework.po
.pofile and fill in the translations in themsgstrfields. Also, ensure thecharsetin the file's header is set toUTF-8:"Content-Type: text/plain; charset=UTF-8\n"
When the source code strings change, you first need to regenerate the .pot file (Step 1), and then use the following command to merge the changes into your existing .po files without losing previous translations.
- Command:
msgmerge --update [path/to/existing.po] [path/to/template.pot]
- Example:
msgmerge --update Language/zh_CN/LC_MESSAGES/StyxTelegramBotFramework.po Language/StyxTelegramBotFramework.pot
Compile the edited .po file into a binary .mo file, which is optimized for the program to read at runtime.
- Command:
msgfmt [path/to/input.po] -o [path/to/output.mo]
- Example:
msgfmt Language/zh_CN/LC_MESSAGES/StyxTelegramBotFramework.po -o Language/zh_CN/LC_MESSAGES/StyxTelegramBotFramework.mo
We warmly welcome any form of contribution! Whether it's reporting a bug, submitting a feature request, or contributing code directly, your help is invaluable.
Before you start, please take a few minutes to read our Contributing Guidelines to ensure a smooth process.
- [BTC]
1C9L21Y4VTbeVeTnccyhZb6ziJfdpyQswz - [USDT-TRC20]
TGMPjDRU92JYjidTu6tRuqZezqrNhWZcYS
