本文整理汇总了Java中org.jivesoftware.util.LocaleUtils.getLocalizedString方法的典型用法代码示例。如果您正苦于以下问题:Java LocaleUtils.getLocalizedString方法的具体用法?Java LocaleUtils.getLocalizedString怎么用?Java LocaleUtils.getLocalizedString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.util.LocaleUtils
的用法示例。
在下文中一共展示了LocaleUtils.getLocalizedString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateStatus
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.session.TransportSession#updateStatus(net.sf.kraken.type.PresenceType, String)
*/
@Override
public void updateStatus(PresenceType presenceType, String verboseStatus) {
if (getTransport().getType().equals(TransportType.icq)) {
request(new SetExtraInfoCmd(((OSCARTransport)getTransport()).convertXMPPStatusToICQ(presenceType)));
}
if (presenceType != PresenceType.available && presenceType != PresenceType.chat) {
String awayMsg = LocaleUtils.getLocalizedString("gateway.oscar.away", "kraken");
if (verboseStatus != null && verboseStatus.length() > 0) {
awayMsg = verboseStatus;
}
request(new SetInfoCmd(InfoData.forAwayMessage(awayMsg)));
if (!getTransport().getType().equals(TransportType.icq)) {
presenceType = PresenceType.away;
}
}
else {
request(new SetInfoCmd(InfoData.forAwayMessage(InfoData.NOT_AWAY)));
request(new SetExtraInfoCmd(new ExtraInfoBlock(ExtraInfoBlock.TYPE_AVAILMSG, ExtraInfoData.getAvailableMessageBlock(verboseStatus == null ? "" : verboseStatus))));
}
setPresenceAndStatus(presenceType, verboseStatus);
}
示例2: addWrittenBytesStat
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
private static void addWrittenBytesStat() {
// Register a statistic.
Statistic statistic = new Statistic() {
public String getName() {
return LocaleUtils.getLocalizedString("server_bytes.stats.outgoing.name");
}
public Type getStatType() {
return Type.rate;
}
public String getDescription() {
return LocaleUtils.getLocalizedString("server_bytes.stats.outgoing.description");
}
public String getUnits() {
return LocaleUtils.getLocalizedString("server_bytes.stats.outgoing.label");
}
public double sample() {
return outgoingCounter.getAndSet(0)/1024d;
}
public boolean isPartialSample() {
return true;
}
};
StatisticsManager.getInstance()
.addMultiStatistic(outgoingStatKey, trafficStatGroup, statistic);
}
示例3: getTerminologyUsername
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyUsername()
*/
@Override
public String getTerminologyUsername() {
return LocaleUtils.getLocalizedString("gateway.gadugadu.username", "kraken");
}
示例4: getTerminologyRegistration
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyRegistration()
*/
@Override
public String getTerminologyRegistration() {
return LocaleUtils.getLocalizedString("gateway.yahoo.registration", "kraken");
}
示例5: getTerminologyRegistration
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
@Override
public String getTerminologyRegistration() {
return LocaleUtils.getLocalizedString("gateway."+getType().toString()+".registration", "kraken");
}
示例6: processGetPacket
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* Processes an IQ stanza of type 'get', which in the context of 'Jabber
* Search' is a request for available search fields.
*
* @param packet
* An IQ stanza of type 'get'
* @return A result IQ stanza that contains the possbile search fields.
*/
private IQ processGetPacket(IQ packet) {
if (!packet.getType().equals(IQ.Type.get)) {
throw new IllegalArgumentException(
"This method only accepts 'get' typed IQ stanzas as an argument.");
}
IQ replyPacket = IQ.createResultIQ(packet);
Element queryResult = DocumentHelper.createElement(QName.get("query",
NAMESPACE_JABBER_IQ_SEARCH));
String instructions = LocaleUtils.getLocalizedString(
"advance.user.search.details", "search");
// non-data form
queryResult.addElement("instructions").addText(instructions);
queryResult.addElement("first");
queryResult.addElement("last");
queryResult.addElement("username");
queryResult.addElement("nick");
queryResult.addElement("city");
queryResult.addElement("email");
DataForm searchForm = new DataForm(DataForm.Type.form);
searchForm.setTitle(LocaleUtils.getLocalizedString(
"advance.user.search.title", "search"));
searchForm.addInstruction(instructions);
searchForm.addField("FORM_TYPE", null, FormField.Type.hidden)
.addValue(NAMESPACE_JABBER_IQ_SEARCH);
searchForm.addField("search",
LocaleUtils.getLocalizedString("advance.user.search.search", "search"),
FormField.Type.text_single)
.setRequired(true);
for (String searchField : getFilteredSearchFields()) {
final FormField field = searchForm.addField();
field.setVariable(searchField);
field.setType(FormField.Type.boolean_type);
field.addValue("1");
field.setLabel(LocaleUtils.getLocalizedString(
"advance.user.search." + searchField.toLowerCase(), "search"));
field.setRequired(false);
}
queryResult.add(searchForm.getElement());
replyPacket.setChildElement(queryResult);
return replyPacket;
}
示例7: getTerminologyUsername
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyUsername()
*/
@Override
public String getTerminologyUsername() {
return LocaleUtils.getLocalizedString("gateway."+getType().toString()+".username", "kraken");
}
示例8: getTerminologyUsername
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyUsername()
*/
@Override
public String getTerminologyUsername() {
return LocaleUtils.getLocalizedString("gateway.irc.username", "kraken");
}
示例9: getTerminologyRegistration
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyRegistration()
*/
@Override
public String getTerminologyRegistration() {
return LocaleUtils.getLocalizedString("gateway.simple.registration", "kraken");
}
示例10: getTerminologyUsername
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
*/
@Override
public String getTerminologyUsername() {
return LocaleUtils.getLocalizedString("gateway.simple.username", "kraken");
}
示例11: getTerminologyRegistration
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyRegistration()
*/
@Override
public String getTerminologyRegistration() {
return LocaleUtils.getLocalizedString("gateway.irc.registration", "kraken");
}
示例12: getTerminologyPassword
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyPassword()
*/
@Override
public String getTerminologyPassword() {
return LocaleUtils.getLocalizedString("gateway.irc.password", "kraken");
}
示例13: getTerminologyPassword
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* @see net.sf.kraken.BaseTransport#getTerminologyPassword()
*/
@Override
public String getTerminologyPassword() {
return LocaleUtils.getLocalizedString("gateway.yahoo.password", "kraken");
}
示例14: MultiUserChatServiceImpl
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* Create a new group chat server.
*
* @param subdomain
* Subdomain portion of the conference services (for example,
* conference for conference.example.org)
* @param description
* Short description of service for disco and such. If
* <tt>null</tt> or empty, a default value will be used.
* @param isHidden
* True if this service should be hidden from services views.
* @throws IllegalArgumentException
* if the provided subdomain is an invalid, according to the JID
* domain definition.
*/
public MultiUserChatServiceImpl(String subdomain, String description, Boolean isHidden) {
// Check subdomain and throw an IllegalArgumentException if its invalid
new JID(null,subdomain + "." + XMPPServer.getInstance().getServerInfo().getXMPPDomain(), null);
this.chatServiceName = subdomain;
if (description != null && description.trim().length() > 0) {
this.chatDescription = description;
}
else {
this.chatDescription = LocaleUtils.getLocalizedString("muc.service-name");
}
this.isHidden = isHidden;
historyStrategy = new HistoryStrategy(null);
}
示例15: getAdminText
import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
* Returns a text element for the admin console, applying the appropriate locale.
* Internationalization logic will only be applied if the String is specially encoded
* in the format "${key.name}". If it is, the String is pulled from the resource bundle.
* If the pluginName is not <tt>null</tt>, the plugin's resource bundle will be used
* to look up the key.
*
* @param string the String.
* @param pluginName the name of the plugin that the i18n String can be found in,
* or <tt>null</tt> if the standard Openfire resource bundle should be used.
* @return the string, or if the string is encoded as an i18n key, the value from
* the appropriate resource bundle.
*/
public static String getAdminText(String string, String pluginName) {
if (string == null) {
return null;
}
// Look for the key symbol:
if (string.indexOf("${") == 0 && string.indexOf("}") == string.length()-1) {
return LocaleUtils.getLocalizedString(string.substring(2, string.length()-1), pluginName);
}
return string;
}