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

Need help for add full translation support!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snake60
Senior Member
Join Date: Jul 2008
Location: Russia, Pskov
Old 03-30-2009 , 08:31   Need help for add full translation support!
Reply With Quote #1

Good time for all!
Need help from community! I am working on this plugin I am add some features and one of them translation support, but I have a small problem. I have this part of code:
Code:
PrintToChatAll( "[SM] %s will %s be switched to opposite team on their death.",	target_name, ( switchOnDeath[target] ? "" : "not" ));
and try add translation:
Code:
PrintToChatAll( "\x01[SM] \x03%s \x01%t \x01%s \x01%t", target_name, "ts will", ( switchOnDeath[target] ? "" : "not"), "ts apposite team on death");
Question: How to add translation support to this small part of string (marks red)???

If anyone help me, I make release new version of this plugin.
Thanks in advance!
Snake60 is offline
Send a message via ICQ to Snake60 Send a message via MSN to Snake60 Send a message via Skype™ to Snake60
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-30-2009 , 09:24   Re: Need help for add full translation support!
Reply With Quote #2

Sorry guys but I will explain it in russian

Тут в одной фразе вставлены две, добавляется предлог "не". Лучше разбить на две отдельные фразы для простоты.
Code:
StrCat(target_name, sizeof(target_name, "\x01");
PrintToChatAll( "\x01[SM] \x03%t", "{Player} will be switched to opposite team on their death", target_name);
PrintToChatAll( "\x01[SM] \x03%t", "{Player} will not be switched to opposite team on their death", target_name);
Тогда файл перевода должен выглядеть так:

Code:
	"{Player} will be switched to opposite team on their death"
	{
		"en"			"{1} will be switched to opposite team on their death."
	}

	"{Player} will not be switched to opposite team on their death"
	{
		"en"			"{1} will not be switched to opposite team on their death."
	}
Я не очень хорошо знаю как работает функция StrCat, но по идее она должна сцеплять две строки. Если не получится так как я выше написал, попробуй поменять местами аргументы функции.
__________________
For admins: My plugins

For developers: Colors library

Last edited by exvel; 03-30-2009 at 13:11.
exvel is offline
Send a message via ICQ to exvel
Snake60
Senior Member
Join Date: Jul 2008
Location: Russia, Pskov
Old 03-30-2009 , 09:47   Re: Need help for add full translation support!
Reply With Quote #3

Дело в том, что здесь завязано условие switchOnDeath и думаю, что функция StrCat не пригодится, но ты натолкнул меня на нужное решение (разбить на два независимых предложения и использовать операторы if и else) Так и сделаю...
Snake60 is offline
Send a message via ICQ to Snake60 Send a message via MSN to Snake60 Send a message via Skype™ to Snake60
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-30-2009 , 11:51   Re: Need help for add full translation support!
Reply With Quote #4

Ну if и else я и подрузомевал как раз, когда говорил, что надо разбить Если что, обращайся.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
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 19:45.


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