Raised This Month: $7 Target: $400
 1% 

Chat Translation


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   Brad (55)
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 05-03-2009 , 22:14   Chat Translation
Reply With Quote #1

+description+
This plugin will take other players chat and translate it according to the language the player has set in their amx_langmenu.

Example:
- There are 12 players speaking English (and have English set in amx_langmenu).
- There are 5 players speaking German (and have German set in amx_langmenu).
- There are 2 players speaking Spanish (and have Spanish set in amx_langmenu).
- The players in English will now see the German's/Spanish's chat in English.
- The players in German will now see the English's/Spanish's chat in German.
- The players in Spanish will now see the English's/German's chat in Spanish.

How it works:
- Before sending the chat message to each player it will first send it to Google's Translation page (http://translate.google.com/translate_t).
- It will now retrieve the translated text and send it on to the selected player.
- If the sending and receiveing player are using the same language it won't use the translator.

Limitations:
- Only the languages supported in amx_langmenu are supported in this plugin.
- 2 languages in amx_langmenu are also not available on Google (Macedonian and l33t).
- Google Translations are not perfect. There will be errors sometimes of course.
- The HL1 engine cannot display some translated characters (that char will be left out of word).

+cvars+
sv_langdomain ".com"
- Sets the domain in which to use on Google for the translation.
- You will want to set this to the domain closest to your server (make sure it exists first!).
- Example: United States will use .com (Default), United Kingdom will use .co.uk

sv_langmod "mod"
- Here you must set the mod name abbreviation you are using (Default: cs).
- Names to choose from: CS, TFC.

sv_translatefile "URL"
- This cvar allows you to enter the URL to the ChatTranslation.php file.
- The closer the URL is to your game server the better.
- If you set this cvar it will use the ChatTranslation.php file before/after translating.
- The ChatTranslation.php file is good to use so it can fix non-english characters.
- You can host the ChatTranslation.php yourself, it's contained in the zip file.

+ChatTranslation.php completed languages+
If language is not listed the non-english characters won't work.
Translators please see this thread.
- German
- Turkish
- French
- Swedish
- Spanish
- Danish
- Dutch
- Finnish
- Bulgarian
- Romanian
- Lithuanian
- More to come.

+games supported+
- Counter-Strike
- Team Fortress Classic

+change log+
Version 1.0 ( 05-03-2009 )
-- Initial release.

Version 1.1 ( 05-03-2009 )
-- Added support for Team Fortress Classic.
-- Added the sv_langmod cvar for mod support.

Version 1.2 ( 05-06-2009 )
-- Fixed quotes cutting off the sentence.
-- The amx_langmenu will pop-up if client doesn't have a language set.

Version 1.3 ( 05-08-2009 )
-- Fixed some text display when a client doesn't select a language.
-- Fixed names displaying incorrectly in TFC if name used certain chars.

Version 2.0 ( 05-09-2009 )
-- Fixed the menu from displaying before player fully spawned.
-- Removed Serbian from the translations as it doesn't work well.
-- Added the sv_translatefile cvar, see the cvar section to see how it works.
Attached Files
File Type: sma Get Plugin or Get Source (ChatTranslation.sma - 2678 views - 11.7 KB)
File Type: zip ChatTranslation.zip (2.3 KB, 1266 views)

Last edited by hlstriker; 05-12-2009 at 21:25.
hlstriker is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-03-2009 , 22:18   Re: Chat Translation
Reply With Quote #2

Great concept, in theory. I have a feeling in actual usage it will not be of much use because most words will be spelled incorrectly ( from my experience). Or does google translation try and interpret mispelled words?
__________________
fysiks is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 05-03-2009 , 22:24   Re: Chat Translation
Reply With Quote #3

This is very creative! Rockin'!

I'm thinking it would be pretty slow and inaccurate, but it's still a great idea Slow and inaccurate is better than nothing.

I might inspect the code and make suggestions later.
__________________
stupok is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 05-03-2009 , 22:37   Re: Chat Translation
Reply With Quote #4

Yes, I thought the same thing. I would much rather read some misspelled / misinterpreted words than a bunch of mumbo-jumbo though!

It's also not as slow as I thought it would be. Thanks to Google only sending minimal data (it's pretty much only 1 string) via HTTP. Even using Google's Japanese server the delay between chat send/receive was only about 0.1 seconds.
hlstriker is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 05-03-2009 , 22:40   Re: Chat Translation
Reply With Quote #5

O_o wow, that's fast
__________________
stupok is offline
orange
Senior Member
Join Date: Dec 2005
Old 05-03-2009 , 23:26   Re: Chat Translation
Reply With Quote #6

Sounds like a good idea but i would rather not have people connecting from all around the world lagging up a u.s server
__________________
orange is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 05-04-2009 , 00:45   Re: Chat Translation
Reply With Quote #7

Added support for Team Fortress Classic
hlstriker is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 05-04-2009 , 06:08   Re: Chat Translation
Reply With Quote #8

Wow this is very nice!
BOYSplayCS is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-04-2009 , 06:32   Re: Chat Translation
Reply With Quote #9

wow, nice job dude ;)
KadiR is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-04-2009 , 06:50   Re: Chat Translation
Reply With Quote #10

Um... Wow.
__________________
hleV is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode