AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   GeoIP Language Selection (https://forums.alliedmods.net/showthread.php?t=153275)

GoD-Tony 03-21-2011 06:11

GeoIP Language Selection
 
1 Attachment(s)
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


Leonardo 03-21-2011 07:39

Re: [ANY] GeoIP Language Selection
 
Changelog:
Country Clan Tags 1.1.0

???

GoD-Tony 03-21-2011 07:44

Re: [ANY] GeoIP Language Selection
 
Haha, fixed it. Thanks!

Vojtoun 04-30-2011 11:39

Re: [ANY] GeoIP Language Selection
 
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

GoD-Tony 04-30-2011 15:17

Re: [ANY] GeoIP Language Selection
 
Quote:

Originally Posted by Vojtoun (Post 1460727)
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.

Vojtoun 04-30-2011 18:28

Re: [ANY] GeoIP Language Selection
 
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.

GoD-Tony 05-01-2011 04:20

Re: [ANY] GeoIP Language Selection
 
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.

Vojtoun 05-01-2011 04:55

Re: [ANY] GeoIP Language Selection
 
Ok, I'll give it a try :wink: Thank you for your help :)

Danny_l4d 05-03-2011 13:31

Re: [ANY] GeoIP Language Selection
 
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

GoD-Tony 05-03-2011 14:33

Re: [ANY] GeoIP Language Selection
 
Quote:

Originally Posted by Danny_l4d (Post 1462628)
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 (Post 1436866)
* Requires SourceMod 1.3.7 or later.

GetLanguageByName was added in 1.3.7.


All times are GMT -4. The time now is 01:54.

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