Garry's Mod

Garry's Mod

611 ratings
Auto Chat Translate
5
3
2
2
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Comic, Fun, Roleplay
File Size
Posted
Updated
8.780 KB
1 Dec, 2023 @ 3:53am
2 Dec, 2023 @ 6:05am
3 Change Notes ( view )

Subscribe to download
Auto Chat Translate

Description
I stole this idea from a cheat and wrote it in about 10 minutes (not accounting for time spent updating it lol).

This uses the google translate api (or libretranslate if you wish so), but you don't need any sort of authorization (which will cause stupid strict ratelimiting).

Usage:
Refer to https :// cloud .google .com/translate/docs/languages for language codes.
1) Change cl_translator_target_language. It controls what language everyones message translates into.
2) Change cl_translator_send_target_language. It controls what language your own messages, if prefixed by "!at", translate into.
3) Use the !at command in chat to translate your text.
4) You don't need to do anything else to have messages by other players translated.

Commands:
cl_translator_target_language "ru" -> Language code to translate other messages to.
cl_translator_send_target_language "ru" -> Language code to translate your own messages to.
cl_translator_delay "10" -> A delay between messages being translated.
cl_translator_type "google" -> libre - libretranslate .com (use a selfhosted instance), google - translate .google .com
cl_translator_libreurl "http :// localhost :5000/" -> The instance URL to use when using the libre translator type.
cl_translator_librekey "" -> API Key for the libretranslate instance. Not needed if the translator type is google.
cl_translator_chat_prefix "!at" -> Prefix for the command to translate your own message.

As mentioned previously you might get ratelimited and I have no guarantee you wont even with default settings. Try setting the delay to a higher value if you still get limited.

If you want to use this on a server that doesn't have it installed, you can try a lua loader. Anti cheats will kill you for it though :)
113 Comments
EdosPonos 23 Mar @ 1:23pm 
what to do if it doesn't translate and it says in the chat "Failed translation. No data?"
certainly and boldly black  [author] 7 Oct, 2024 @ 4:48am 
pohui)
Provatan 2 Oct, 2024 @ 2:02am 
Ахахах а страница в стиме не переведне
distantexplosion 2 Oct, 2024 @ 1:31am 
Does this work for German?
certainly and boldly black  [author] 2 Oct, 2024 @ 12:17am 
sorry for your loss
>KB> >KEKSQUAD 29 Sep, 2024 @ 1:56pm 
[ERROR] lua/autorun/client/auto_translate.lua:44: Tried to use a NULL entity!
1. Name - [C]:-1
2. onsuccess - lua/autorun/client/auto_translate.lua:44
3. unknown - lua/includes/modules/http.lua:58
>KB> >KEKSQUAD 16 Sep, 2024 @ 9:03am 
Pro-tip: you can also type gmod_language en into console to see what language code your game is using
Pamelkin 30 Jun, 2024 @ 10:36pm 
что делаь если консоль не видит команду
certainly and boldly black  [author] 30 May, 2024 @ 11:45am 
this is already clientside, all you need is a way to execute it anywhere you want
AToM1C 30 May, 2024 @ 11:25am 
can someone make this clientside