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
problems with translation
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.
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
The SmartFoxServer Team
customize almost all messages
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""
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""
Re: customize almost all messages
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
The SmartFoxServer Team
Tks
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
}
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 28 guests