Translate Counter-Strike 2 chat messages in real time using simple in-game commands like tm_de, _tl, and code_french, while keeping in-game chat clean and readable. The tool reads your console.log, translates messages via Google Translate, and sends responses back into the game using a configurable keybind.
Note: CS2 must be started with the Steam launch option
-condebugso thatconsole.logis actually written. See “Enable console logging (-condebug)" below.
-
In-game translation commands
tm_<lang> TEXTTranslate arbitrary text to<lang>and send it to chat. Example:tm_de hello friends_tl [lang]Translate the last normal chat message to[lang](default:en) and send it to chat.code_<language>Fuzzy search for language names and show the matchingtm_<code>helper. Example:code_french→For French use tm_fr
-
Automatic console translation
- All non-command messages are automatically translated to a target language (default: English) in the terminal only.
- Does not spam the in-game chat.
-
Config-based setup
-
User config stored under:
- Linux:
~/.config/cs2-chat-translator/config.json
- Linux:
-
CLI helpers to initialize and adjust config (log path, cfg directory, bind key).
-
-
No owner logic, no blacklist
-
This edition focuses purely on:
tm__tlcode_- auto-translate to console
-
-
CS2 writes chat lines into
console.log(via-condebug). -
The tool tails
console.logand parses lines like:[CT] PlayerName: message[T] PlayerName: message[ALL] PlayerName: message
-
Depending on the content:
- Commands (
tm_,_tl,code_) trigger translations and responses via in-game chat. - All other lines (non-command messages) are translated to a target language and printed in the terminal.
- Commands (
-
Responses to be sent to CS2 are written into
chat_reader.cfgand executed via a bind key usingxdotool.
-
OS: Linux (tested with CS2 under Steam/Proton)
-
Runtime:
- Node.js 18+ (ESM + modern
fsAPIs) xdotool(to simulate the keypress that executeschat_reader.cfg)
- Node.js 18+ (ESM + modern
-
Network: Internet connection (for Google Translate)
-
Game: Counter-Strike 2 with console logging enabled via
-condebug
CS2 must be told to write the console output to console.log. This is critical; without it, the tool has nothing to read.
-
Open Steam.
-
Go to Library → Right click on Counter-Strike 2 → Properties….
-
Under Launch Options, add:
-condebug -
Start CS2 once so that
console.loggets created.
The file is typically located in something like:
~/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/console.log
(You can override the exact path in the config.)
If you are on Arch Linux or a derivative (e.g. EndeavourOS, CachyOS, Manjaro) and the package is available in the AUR:
yay -S cs2-chat-translator
# or
paru -S cs2-chat-translatorThis will:
- Install the tool under
/usr/lib/cs2-chat-translator - Expose the CLI as
cs2-chat-translatorin your$PATH
Clone the repository:
git clone https://github.com/MeckeDev/cs2-chat-translator.git
cd cs2-chat-translatorInstall dependencies:
npm installMake sure the main CLI file is executable:
chmod +x bin/cs2-chat-translator.jsYou can now run it directly:
node bin/cs2-chat-translator.jsOr link it globally via npm link (optional):
npm link
cs2-chat-translator --helpThe tool uses a simple JSON config file:
- Linux:
~/.config/cs2-chat-translator/config.json
Example content:
{
"logPath": "/home/youruser/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/console.log",
"cfgDir": "/home/youruser/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg",
"bindKey": "l"
}The CLI provides some helper flags to create and edit the config without manually opening the file:
-
Initialize or refresh config with sane defaults:
cs2-chat-translator --init-config
-
Set the path to
console.log:cs2-chat-translator --set-log-path /full/path/to/console.log
-
Set the CS2
cfgdirectory:cs2-chat-translator --set-cfg-dir /full/path/to/csgo/cfg
-
Change the bind key (the key used in CS2 to execute
chat_reader.cfg):cs2-chat-translator --set-bind-key l
These commands will update ~/.config/cs2-chat-translator/config.json. You can still fine-tune it manually if needed.
As described above, add -condebug to your CS2 Steam launch options and start the game once.
Typical path under Linux with Steam/Proton:
~/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg
Use this as cfgDir in the config.
In your CS2 cfg folder, you will have your own configuration files like autoexec.cfg. Add a line similar to:
bind l "exec chat_reader.cfg"
Replace l with whatever key you configured as bindKey in config.json.
The tool will write its output into chat_reader.cfg, and pressing the bound key will cause CS2 to send the corresponding chat message.
Once configured:
cs2-chat-translator --init-config # first time, optional but recommended
cs2-chat-translatorYou should see something like:
🚀 CS2 Chat Translator (watching console.log)
Commands:
• tm_<lang> TEXT → translate TEXT to <lang> (chat output, e.g., tm_de hello)
• _tl [lang] → translate last message to [lang] (default en)
• code_<langname> → show helper like 'For French use tm_fr'
Auto-Translate:
• Non-commands → shown in console as '<from> → EN'
Keep this terminal window open while you play CS2.
All commands are typed directly into the CS2 chat.
Translate arbitrary text into the target language and send it to chat.
-
Example:
tm_de hello friends
-
Output in chat (example):
YourName said - Hallo Freunde - (from English)
Supported languages are based on Google Translate’s language codes (e.g. en, de, fr, es, ru, pt, zh_cn, zh_tw, …).
Translate the last normal chat message.
-
If
langis omitted, defaults toen. -
Example:
- Someone writes in Russian:
Привет, как дела? - In console you see auto-translation.
- You type:
_tl de
- Someone writes in Russian:
-
Output in chat (example):
TheirName said - Wie geht es dir? - (from Russian)
The tool keeps track of the last non-command, non-empty message for _tl.
Helps you find the correct tm_<code> for a human-readable language name using fuzzy matching.
-
Examples:
code_french→For French use tm_frcode brasil→ likelyFor Portuguese use tm_ptcode simplified chinese→ might suggesttm_zh_cn
This is useful when you don’t remember the exact language code.
All normal chat messages (that are not commands) are automatically translated to a target language (default: English) and printed in the terminal.
Example console output:
🌍 [T] Player123 (Russian → EN): Hello, how are you?
This allows you to see what’s going on without spamming the in-game chat.
If you see an error like:
❌ console.log not found: /path/to/console.log
Check:
- CS2 is launched with
-condebug. - The
logPathinconfig.jsonis correct. - The file actually exists and is being updated while you play.
You can fix the path via:
cs2-chat-translator --set-log-path /correct/path/to/console.logIf you see messages like:
xdotool error: ...
Ensure:
-
xdotoolis installed:sudo pacman -S xdotool # Arch -
The window focus is on CS2 when the script triggers.
-
The
bindKeyin your config matches the bind in your CS2 cfg.
- Google Translate may throttle or change behavior.
- Cyrillic text has a heuristic to prefer Russian (
ru) if detection seems off. - If
smartTranslatefails, the original text may be returned without changes.
Install dev dependencies and run from the repo:
git clone https://github.com/MeckeDev/cs2-chat-translator.git
cd cs2-chat-translator
npm install
node bin/cs2-chat-translator.js --init-config
node bin/cs2-chat-translator.jsYou can edit the source, adjust behavior, and keep using the same config file. Contributions and forks are welcome as long as the license terms are respected.
This project is open source. See the LICENSE file in the repository for full details.