Raised This Month: $51 Target: $400
 12% 

native menu_setprop(menu, prop, ...); and multi language


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-11-2015 , 23:13   native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #1

Hi, first of all, why not make menus with auto translations?
I not searched, but i think the developers have a good reason

Second, The Next, Exit, Back And More in new menus are not auto translatable?
If is translatable, not working in last amxx-dev release.

About menu_setprop, if the devs want to make new menus in amxx multi-language, they can add in this native something like this:

PHP Code:
native menu_setprop(MyMenuMPROP_LANGUAGE"en"); 
This is my idea, but lets wait someone reply this

Thanks 4 n1ce work with amxx dev!!!11!1!11
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-12-2015 , 01:12   Re: native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #2

You can easily make menus multilingual using format/formatex() as well as the following for the administrative options:

Code:
#define MPROP_BACKNAME	2		/* Name of the back button (param1 = string) */
#define MPROP_NEXTNAME	3		/* Name of the next button (param1 = string) */
#define MPROP_EXITNAME	4		/* Name of the exit button (param1 = string) */
__________________
fysiks is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-12-2015 , 03:06   Re: native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
You can easily make menus multilingual using format/formatex() as well as the following for the administrative options:

Code:
#define MPROP_BACKNAME    2        /* Name of the back button (param1 = string) */
#define MPROP_NEXTNAME    3        /* Name of the next button (param1 = string) */
#define MPROP_EXITNAME    4        /* Name of the exit button (param1 = string) */
Yes, but is not only this, i mean change all options I.E

At code:
PHP Code:
iMenu menu_create("MY_MENU","MenuHandle",true /* ML */);

menu_additem(iMenu,"OPTION_1","0");
menu_additem(iMenu,"OPTION_2","1"); 
At Lang file:

Code:
[en]
MY_MENU = Menu Title
OPTION_1 = Option 1
OPTION_2 = Option 2
And i can change the language with a simple menu_setprop.
Maybe I'm not explaining properly, I hope you understand
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-12-2015 , 10:36   Re: native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #4

If I understood what you mean, IMO it should not be added. If you only can set the language by the native what is the point of having a ML file ? The menu will be always in the language specified by you, and someone else needs to edit the source code. If I get it wrong, please explain.
__________________
HamletEagle is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-12-2015 , 11:50   Re: native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
If I understood what you mean, IMO it should not be added. If you only can set the language by the native what is the point of having a ML file ? The menu will be always in the language specified by you, and someone else needs to edit the source code. If I get it wrong, please explain.
Not, will not be static in source, because you can get amx_language convar to put in menu_setprop...

And the real purpose is use amxx language in menus by player (LANG_PLAYER) not LANG_SERVER.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-12-2015 , 19:34   Re: native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #6

I don't think you understood what I said. The way that you can do this, right now, is this:

PHP Code:
new szString[64]

formatex(szStringcharsmax(szString), "%L"id"MY_MENU")
iMenu menu_create(szString"MenuHandler");

formatex(szStringcharsmax(szString), "%L"id"OPTION_1")
menu_additem(iMenuszString"0");
formatex(szStringcharsmax(szString), "%L"id"OPTION_2")
menu_additem(iMenuszString"1"); 
You can do this same thing with the menu properties that I mentioned above.

The only thing that you can't do with this is build one menu and display that one menu to everybody. This means you can't use global menus that don't use LANG_SERVER. This would be the only added benefit of what you are suggesting. I'm guessing it would be a significant change in the code which probably wouldn't be worth the effort.
__________________

Last edited by fysiks; 03-12-2015 at 19:35.
fysiks is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 03-13-2015 , 09:51   Re: native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #7

I have been thinking about doing this, as I believe it was the original intent of the (currently unused) ml parameter for menu_create(). No promises of course, but this may become a thing in the future.
__________________
In Flames we trust!
Nextra is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-13-2015 , 10:49   Re: native menu_setprop(menu, prop, ...); and multi language
Reply With Quote #8

Quote:
Originally Posted by Nextra View Post
I have been thinking about doing this, as I believe it was the original intent of the (currently unused) ml parameter for menu_create(). No promises of course, but this may become a thing in the future.
Yes, because uses format(ex) in every additem i think can be replaced with this. Using a simple ML parameter.

I said about menu_setprop because can be added to change the language menu with a simple prop.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Reply



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 06:08.


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