Simple C++ console chat and translation application.
ZChat provides a minimal command-line interface that uses a translator
component to process and translate text.
The translator permits writing messages with a special prefix to
automatically translate text using external APIs.
- Entry point (CLI):
ZChat.cpp - Translator implementation:
ZTranslator.cpp - Public translator API:
ZTranslator.h
ZChat.cpp--- application entry point and CLI handling.ZTranslator.cpp--- implementation of translation logic and API calls.ZTranslator.h--- public API and translation utilities.
- C++17-compatible compiler (g++, clang, MSVC)
- Optional: CMake for easier builds
Compile with g++:
g++ -std=c++17 -O2 -Wall ZChat.cpp ZTranslator.cpp -o zchatThe translator accepts inline commands to translate text from one language to another.
:FROM:TO Your text here
Where:
FROM= language code of the original text\TO= language code to translate to\Your text here= the message you want to translate
:es:en Hola cómo estás
:en:es Hello friend
:pt:es Bom dia meu amigo
:fr:en Bonjour, je suis prêt
:ja:en こんにちは
Code Language
es Spanish en English pt Portuguese fr French it Italian de German ja Japanese ru Russian ko Korean zh Chinese
- The user types a message with the
:from:toprefix.\ ZTranslator::IsTranslationRequest()checks if the format is valid.\TranslateWithAPI()performs the translation asynchronously.\- The translated message replaces the original message.\
- ZChat sends it normally through the game's chat system.
User writes:
:es:en Hola mi amigo
Final message sent to chat:
[ES→EN] Hello my friend

