Raised This Month: $ Target: $400
 0% 

[ H3LP ] GetLangTransKey


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-28-2018 , 16:40   [ H3LP ] GetLangTransKey
Reply With Quote #1

Hello, I was trying to get a translation key and I came across a problem.

First code, return TransKey_Bad.
Code:
formatex(szTransKey, charsmax(szTransKey), "ZOMBIENAME %s", rgZombieClass[ZOMBIE_SECTION]); if (GetLangTransKey(szTransKey) != TransKey_Bad)     formatex(rgZombieClass[ZOMBIE_NAME], charsmax(rgZombieClass[ZOMBIE_NAME]), "%L", this, szTransKey);

Code:
[bp]
ZOMBIENAME Heavy Zombie = Zumbi Pesado

Now if replace " " with "_", return the right translation key.
Code:
formatex(szTransKey, charsmax(szTransKey), "ZOMBIENAME %s", rgZombieClass[ZOMBIE_SECTION]); replace_string(szTransKey, charsmax(replace_string), " ", "_");         if (GetLangTransKey(szTransKey) != TransKey_Bad)     formatex(rgZombieClass[ZOMBIE_NAME], charsmax(rgZombieClass[ZOMBIE_NAME]), "%L", this, szTransKey);

Code:
[bp]
ZOMBIENAME_Heavy_Zombie = Zumbi Pesado
If the transkey contains white spaces, the GetLangTransKey always return -1. Is this a bug or is there one "restriction" related to lang file format (syntax)?
__________________









Last edited by CrazY.; 09-29-2018 at 08:10.
CrazY. is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 09-28-2018 , 17:32   Re: [ H4LP ] GetLangTransKey
Reply With Quote #2

It means the key is a word not a string.
__________________
My English is A0
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-28-2018 , 18:14   Re: [ H4LP ] GetLangTransKey
Reply With Quote #3

I don't see where what you said is related to my question.
__________________








CrazY. is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 09-29-2018 , 17:24   Re: [ H4LP ] GetLangTransKey
Reply With Quote #4

Quote:
Originally Posted by CrazY. View Post
I don't see where what you said is related to my question.
Here:
ZOMBIENAME Heavy Zombie = Zumbi Pesado
you have 3 words.

And here:
ZOMBIENAME_Heavy_Zombie = Zumbi Pesado
one big word.
__________________
My English is A0
E1_531G is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-29-2018 , 18:05   Re: [ H3LP ] GetLangTransKey
Reply With Quote #5

Just use the second method replacing the spaces with _ (underscore) probably because its parsing using the spaces
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 07:14.


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