problems with translation

Everything about the SmartFoxBits UI Components for SmartFoxServer 1.x. Post your questions, suggestions and bug reports.

Moderators: Lapo, Bax

pac00l
Posts: 8
Joined: 24 Aug 2008, 00:56

problems with translation

Postby pac00l » 14 Oct 2008, 04:16

the are many problems with translation, for example the button "send" of UserList component or "1 message to read" or "This user name is already taken." in LoginBox component

Please help me
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 14 Oct 2008, 08:03

You can customize almost all messages.
For the buttons, you can access their instances and change the labels (check API).
In the UserList you will have to implement your own item renderer (check documentation).
For the login errors customization is not possible, but you can register to the Connector's events (onLogin in this case) and change the text inside the error textfield by accessing it with the Connector.errorTextField property.
Paolo Bax
The SmartFoxServer Team
pac00l
Posts: 8
Joined: 24 Aug 2008, 00:56

customize almost all messages

Postby pac00l » 14 Oct 2008, 11:56

thanks Bax

Message "This user name is already taken." at LoginBox component

Solution:

mc_connector.addEventListener(SFSEvent.onLogin,Delegate.create(this, onLogin));

function onLogin(evt:SFSEvent):Void {

if(evt.params.resObj.error!=""){
loginBox_mc.errorTextField.text="Su nombre ya está en uso"
}

}

but to UserList i can't find the send private message button and the label "X message to read""
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: customize almost all messages

Postby Bax » 15 Oct 2008, 08:21

pac00l wrote:but to UserList i can't find the send private message button and the label "X message to read""

The UserList contains an instance of the ChatBox (UserList.privateChat) which contains the instance of the send button.
As it regards the message, check the UserList.labelFunction property in the API documentation. The example shows the internal behavior of the UserList: you just have to create you own function copying the example and re-assign it to the labelFunction property.
To change the text language, simply change this line:

Code: Select all

label += String(item.newMsgCount) + " message" + (item.newMsgCount > 1 ? "s" : "") + " to read"
Paolo Bax
The SmartFoxServer Team
pac00l
Posts: 8
Joined: 24 Aug 2008, 00:56

Tks

Postby pac00l » 15 Oct 2008, 15:07

Tks again bax


button "send" of UserList component

Solution:

listUsers.privateChat.sendButtonText="Enviar";




"1 message to read" of UserList component

Solution:


listUsers.labelFunction = setCustomUserLabel

function setCustomUserLabel(item:Object):String
{
var user = item.userData
var label:String = "<font size='10'"

if (item.newMsgCount > 0)
label += " color='#" + newPrivateMsgLabelColor.toString(16) + "'"

label += ">" + user.getName() + "</font>"

if (item.newMsgCount > 0)
{
label += "<br>"
label += "<font size='9' color='#666666'>"
label += String(item.newMsgCount) + " mensaje" + (item.newMsgCount > 1 ? "s" : "") + " privado"
label += "</font>"
}

return label
}

Return to “SmartFoxBits for SFS 1.x”

Who is online

Users browsing this forum: No registered users and 2 guests