Raised This Month: $ Target: $400
 0% 

what does register_dictionary() do?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
predator
Junior Member
Join Date: Aug 2004
Old 09-23-2004 , 14:48   what does register_dictionary() do?
Reply With Quote #1

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?
__________________
predator is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 09-23-2004 , 14:51  
Reply With Quote #2

used for support of other languages

Multi-Language-Support
FeuerSturm is offline
BAILOPAN
Join Date: Jan 2004
Old 09-23-2004 , 14:53  
Reply With Quote #3

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)
__________________
egg
BAILOPAN is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 09-23-2004 , 14:53  
Reply With Quote #4

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

BigBaller is offline
predator
Junior Member
Join Date: Aug 2004
Old 09-23-2004 , 15:00  
Reply With Quote #5

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

I'll have to use that now, it sounds great
__________________
predator 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 17:16.


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