Raised This Month: $32 Target: $400
 8% 

GeoIP Language Selection


Post New Thread Reply   
 
Thread Tools Display Modes
Author
GoD-Tony
Veteran Member
Join Date: Jul 2005
Plugin ID:
2284
Plugin Version:
1.3.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    51 
    Plugin Description:
    Automatically assign languages to players geographically
    Old 03-21-2011 , 06:11   GeoIP Language Selection
    Reply With Quote #1

    GeoIP Language Selection

    Every time a player joins your server, they are assigned a language that SourceMod will use for translations. SourceMod does this by using the same language that the player installed with Steam. There are two drawbacks to this method:
    1. SourceMod can only support the same languages that Steam supports. It contains some languages that can't always be used on players (Latvian, Lithuanian, etc).
    2. Many players install Steam using the default language (English) regardless of their understanding.
    This plugin will automatically assign a language to a player based on which country they join from. It works with SourceMod's method, meaning that it only acts on players using the default language of Steam. If a player prefers another language, they are given that option as well.

    Installation:

    Extract the contents of the *.zip to your SourceMod directory.

    Adding New Languages:

    When adding a new language, it's important to use the English name of the language. You can find a list of language codes here. We will use Greek as an example.

    Add the language to sourcemod/ configs/ languages.cfg:
    Code:
    "Languages"
    {
    	"en"		"English"
    	"el"		"Greek"
    }
    Then you can begin translating as usual. All players from Greece will now be automatically using these translations.

    Commands:
    • !language - Display the language selection menu.
    • !language <name> - Directly change your language.
    Notes:
    • You should use the latest GeoIP database with this plugin.
    • This plugin supports automatic updates via Updater.
    • Credit to thetwistedpanda & Leonardo as I borrowed some clientprefs/menu code from their plugins.
    Changelog:
    Quote:
    GeoIP Language Selection 1.3.0
    - Fixed Chinese & Portuguese not being correctly assigned.
    - Added language forward for plugins.
    - Country-Language assignment can now be configured.
    - Several performance improvements.

    GeoIP Language Selection 1.2.0
    - Added support for automatic updates via Updater.
    - Made clientprefs optional.
    - Removed colours in chat notifications.
    - Internal code changes and clean up.

    GeoIP Language Selection 1.1.0
    - Added language selection menu
    - Initial release
    Attached Files
    File Type: zip GeoLanguage-1.3.0.zip (13.0 KB, 2080 views)
    __________________

    Last edited by GoD-Tony; 12-26-2012 at 05:22.
    GoD-Tony is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 03-21-2011 , 07:39   Re: [ANY] GeoIP Language Selection
    Reply With Quote #2

    Changelog:
    Country Clan Tags 1.1.0

    ???
    __________________

    Last edited by Leonardo; 03-21-2011 at 07:42.
    Leonardo is offline
    GoD-Tony
    Veteran Member
    Join Date: Jul 2005
    Old 03-21-2011 , 07:44   Re: [ANY] GeoIP Language Selection
    Reply With Quote #3

    Haha, fixed it. Thanks!

    Last edited by GoD-Tony; 03-21-2011 at 07:51.
    GoD-Tony is offline
    Vojtoun
    Member
    Join Date: Apr 2009
    Old 04-30-2011 , 11:39   Re: [ANY] GeoIP Language Selection
    Reply With Quote #4

    Hi, I'm using your plugin and it works great but I have little problem with translations of admin menu. To be more specific custom plugins which are using translations and have some of its commands built-in admin menu are displaying wrong. For example, I'm using Spray Tracer (showthread.php?p=665448) but when I open admin menu, it sometimes shows english translations and sometimes czech translations. My question is, is this problem plugin-sided or server-sided? There are no error logs what so ever, so I'm pretty desperate, because I really want to use this plugin.

    Thank you in advance,
    Vojtoun
    __________________
    Vojtoun is offline
    GoD-Tony
    Veteran Member
    Join Date: Jul 2005
    Old 04-30-2011 , 15:17   Re: [ANY] GeoIP Language Selection
    Reply With Quote #5

    Quote:
    Originally Posted by Vojtoun View Post
    when I open admin menu, it sometimes shows english translations and sometimes czech translations.
    Does this happen after reconnecting to the server? Or is it changing between Czech and English randomly?

    You can verify which language you are set to by bringing up the !language menu. If it says you are set to Czech and some custom menus are displaying in English, then it sounds like a problem with those plugins' menus.

    Are you sure that you have properly added a Czech translation for the Spray Tracer plugin? Otherwise it will default to English.
    GoD-Tony is offline
    Vojtoun
    Member
    Join Date: Apr 2009
    Old 04-30-2011 , 18:28   Re: [ANY] GeoIP Language Selection
    Reply With Quote #6

    Translations are changing randomly while connected to the server. Both translations are ok, I've tried using them separatly and they are working properly. Here's a little description of what is going on:

    1. I bring up admin menu and so far it's ok and everything is translated fine.
    2. I choose Server Commands, and built-in functions of SourceMod are translated, but SprayTracer options are sometimes translated to english and sometimes to czech (this happens randomly and it changes without reconnecting, which is the one thing that's really weird, because I don't understand why it's choosing english translations one time and czech translations other time. Another thing I've noticed is, that it only affects admin menu translations, everything else is working fine.

    I apologize if my english isn't that good, but I've tried to desribe it as good as I can. If you want, I can paste here both english and czech translations of SprayTracer which I'm using.
    __________________

    Last edited by Vojtoun; 04-30-2011 at 18:31.
    Vojtoun is offline
    GoD-Tony
    Veteran Member
    Join Date: Jul 2005
    Old 05-01-2011 , 04:20   Re: [ANY] GeoIP Language Selection
    Reply With Quote #7

    It appears to be a bug with the Spray Tracer plugin. After looking at the source, I see that a lot of translations are formatted improperly.

    For example:
    Code:
    Format(warn, 127, "%t", "Warn");

    Should be:
    Code:
    Format(warn, 127, "%T", "Warn", client);

    This is causing the menu to fall back to the server language (English in this case) on some occasions. I suggest reporting this bug to that specific plugin.

    Last edited by GoD-Tony; 05-02-2011 at 11:02. Reason: typo
    GoD-Tony is offline
    Vojtoun
    Member
    Join Date: Apr 2009
    Old 05-01-2011 , 04:55   Re: [ANY] GeoIP Language Selection
    Reply With Quote #8

    Ok, I'll give it a try Thank you for your help
    __________________
    Vojtoun is offline
    Danny_l4d
    Senior Member
    Join Date: Feb 2010
    Old 05-03-2011 , 13:31   Re: [ANY] GeoIP Language Selection
    Reply With Quote #9

    I use this

    PHP Code:
    "Languages"
    {
        
    "en"            "English"
        "nl"            "Dutch"

    but get this error

    PHP Code:
    [SMUnable to load plugin "l4d_geolanguage.smx"Native "GetLanguageByName" was not found 
    can't seem to find the problem
    __________________
    Danny_l4d is offline
    GoD-Tony
    Veteran Member
    Join Date: Jul 2005
    Old 05-03-2011 , 14:33   Re: [ANY] GeoIP Language Selection
    Reply With Quote #10

    Quote:
    Originally Posted by Danny_l4d View Post
    PHP Code:
    [SMUnable to load plugin "l4d_geolanguage.smx"Native "GetLanguageByName" was not found 
    can't seem to find the problem
    Quote:
    Originally Posted by GoD-Tony View Post
    * Requires SourceMod 1.3.7 or later.
    GetLanguageByName was added in 1.3.7.
    GoD-Tony 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 20:24.


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