当前位置: 首页>>代码示例>>Java>>正文


Java LocaleUtils.getLocalizedString方法代码示例

本文整理汇总了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);
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:25,代码来源:OSCARSession.java

示例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);
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:31,代码来源:ServerTrafficCounter.java

示例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");
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:8,代码来源:GaduGaduTransport.java

示例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");
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:8,代码来源:YahooTransport.java

示例5: getTerminologyRegistration

import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
@Override
public String getTerminologyRegistration() {
    return LocaleUtils.getLocalizedString("gateway."+getType().toString()+".registration", "kraken");
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:5,代码来源:XMPPTransport.java

示例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;
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:60,代码来源:SearchPlugin.java

示例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");
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:8,代码来源:OSCARTransport.java

示例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");
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:8,代码来源:IRCTransport.java

示例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");
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:8,代码来源:SimpleTransport.java

示例10: getTerminologyUsername

import org.jivesoftware.util.LocaleUtils; //导入方法依赖的package包/类
/**
 */
@Override
public String getTerminologyUsername() {
    return LocaleUtils.getLocalizedString("gateway.simple.username", "kraken");
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:7,代码来源:SimpleTransport.java

示例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");
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:8,代码来源:IRCTransport.java

示例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");
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:8,代码来源:IRCTransport.java

示例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");
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:8,代码来源:YahooTransport.java

示例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);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:30,代码来源:MultiUserChatServiceImpl.java

示例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;
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:24,代码来源:AdminConsole.java


注:本文中的org.jivesoftware.util.LocaleUtils.getLocalizedString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。