AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what does register_dictionary() do? (https://forums.alliedmods.net/showthread.php?t=6183)

predator 09-23-2004 14:48

what does register_dictionary() do?
 
I've seen register_dictionary() used in a very few plugins and all of those are base plugins written by the AMXX team, and I haven't been able to figure out what it is for from the code. I looked for it in the function list but it wasn't there. I am as a result extremely curious as to what it is for. Can anyone tell me?

FeuerSturm 09-23-2004 14:51

used for support of other languages :wink:

Multi-Language-Support :wink:

BAILOPAN 09-23-2004 14:53

It's used in multi-lingual plugins. You pass it a file located in "data/lang", and it will make sure the file's translations are loaded into the database.

For example:
register_dictionary("myplugin.txt")

data/lang/myplugin.txt:
Code:

[en]
hello_world = Hello, world!
goodbye = Goodbye!
greeting = Hello, %s!

Then the plugin can do something like:
get_user_name(id, name, 31)
client_print(id, print_chat, "%L", id, "greeting", name)

BigBaller 09-23-2004 14:53

Most if not all plugins will soon be using this because the mutli lingal system is just great :)

predator 09-23-2004 15:00

Cool. Thanks a bunch guys. That was really bugging me. :)

I'll have to use that now, it sounds great :)


All times are GMT -4. The time now is 17:16.

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