Java 类com.liferay.portal.kernel.util.LocalizationUtil 实例源码

项目:index-checker    文件:IndexSearchHelper.java   
public void fillDataObject(Data data, String[] attributes, Document doc) {
    data.set(Field.UID, doc.getUID());

    Locale[] locales = LanguageUtil.getAvailableLocales().toArray(
            new Locale[0]);
    Locale siteLocale = LocaleUtil.getSiteDefault();

    for (String attribute : attributes) {
        String attrDoc = ConfigurationUtil.getIndexAttributeName(
            data.getModel(), attribute);

        List<Map<Locale, String>> listValueMap = null;

        Class<?> typeClass = data.getAttributeClass(attribute);

        if (typeClass.equals(String.class) ||
            typeClass.equals(Object.class)) {

            listValueMap = getLocalizedMap(locales, doc, attrDoc);
        }

        if ((listValueMap != null) && !listValueMap.isEmpty()) {
            String[] xml = new String[listValueMap.size()];

            int pos = 0;

            for (Map<Locale, String> valueMap : listValueMap) {
                xml[pos++] = LocalizationUtil.updateLocalization(
                    valueMap, "", "data",
                    LocaleUtil.toLanguageId(siteLocale));
            }

            data.set(attribute, xml);
        }
        else if (doc.hasField(attrDoc)) {
            data.set(attribute, doc.getField(attrDoc).getValues());
        }
    }
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public void setDiplomaTemplate(String diplomaTemplate, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(diplomaTemplate)) {
        setDiplomaTemplate(LocalizationUtil.updateLocalization(
                getDiplomaTemplate(), "DiplomaTemplate", diplomaTemplate,
                languageId, defaultLanguageId));
    }
    else {
        setDiplomaTemplate(LocalizationUtil.removeLocalization(
                getDiplomaTemplate(), "DiplomaTemplate", languageId));
    }
}
项目:liferaylms-portlet    文件:ModuleClp.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:ModuleClp.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:liferaylms-portlet    文件:CourseClp.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:CourseClp.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:liferaylms-portlet    文件:ModuleModelImpl.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:ModuleModelImpl.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:liferaylms-portlet    文件:CourseModelImpl.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:CourseModelImpl.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:liferaylms-portlet    文件:CompetenceModelImpl.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:CompetenceModelImpl.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:liferaylms-portlet    文件:CompetenceModelImpl.java   
public void setDiplomaTemplate(String diplomaTemplate, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(diplomaTemplate)) {
        setDiplomaTemplate(LocalizationUtil.updateLocalization(
                getDiplomaTemplate(), "DiplomaTemplate", diplomaTemplate,
                languageId, defaultLanguageId));
    }
    else {
        setDiplomaTemplate(LocalizationUtil.removeLocalization(
                getDiplomaTemplate(), "DiplomaTemplate", languageId));
    }
}
项目:liferaylms-portlet    文件:LearningActivityModelImpl.java   
public void setTitle(String title, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(title)) {
        setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
                title, languageId, defaultLanguageId));
    }
    else {
        setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
                languageId));
    }
}
项目:liferaylms-portlet    文件:LearningActivityModelImpl.java   
public void setDescription(String description, Locale locale,
    Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
        setDescription(LocalizationUtil.updateLocalization(
                getDescription(), "Description", description, languageId,
                defaultLanguageId));
    }
    else {
        setDescription(LocalizationUtil.removeLocalization(
                getDescription(), "Description", languageId));
    }
}
项目:edemocracia    文件:ConfigurationActionImpl.java   
protected void updateThreadPriorities(ActionRequest actionRequest)
    throws Exception {

    Locale[] locales = LanguageUtil.getAvailableLocales();

    for (int i = 0; i < locales.length; i++) {
        String languageId = LocaleUtil.toLanguageId(locales[i]);

        List<String> priorities = new ArrayList<String>();

        for (int j = 0; j < 10; j++) {
            String name = ParamUtil.getString(
                actionRequest, "priorityName" + j + "_" + languageId);
            String image = ParamUtil.getString(
                actionRequest, "priorityImage" + j + "_" + languageId);
            double value = ParamUtil.getDouble(
                actionRequest, "priorityValue" + j + "_" + languageId);

            if (Validator.isNotNull(name) || Validator.isNotNull(image) ||
                (value != 0.0)) {

                priorities.add(
                    name + StringPool.COMMA + image + StringPool.COMMA +
                        value);
            }
        }

        String preferenceName = LocalizationUtil.getPreferencesKey(
            "priorities", languageId);

        setPreference(
            actionRequest, preferenceName,
            priorities.toArray(new String[priorities.size()]));
    }
}
项目:data-manipulator    文件:StringUtil.java   
public static String getLocalizedContent(String content) {
    return LocalizationUtil.updateLocalization(
        StringPool.BLANK, "static-content" ,content);
}
项目:data-manipulator    文件:StringUtil.java   
public static Map<Locale, String> getLocalizationMap(String content) {
    return LocalizationUtil.getLocalizationMap(content);
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public String getTitle(String languageId) {
    return LocalizationUtil.getLocalization(getTitle(), languageId);
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public String getTitle(String languageId, boolean useDefault) {
    return LocalizationUtil.getLocalization(getTitle(), languageId,
        useDefault);
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public Map<Locale, String> getTitleMap() {
    return LocalizationUtil.getLocalizationMap(getTitle());
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public String getDescription(String languageId) {
    return LocalizationUtil.getLocalization(getDescription(), languageId);
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public String getDescription(String languageId, boolean useDefault) {
    return LocalizationUtil.getLocalization(getDescription(), languageId,
        useDefault);
}
项目:liferaylms-portlet    文件:LearningActivityClp.java   
public Map<Locale, String> getDescriptionMap() {
    return LocalizationUtil.getLocalizationMap(getDescription());
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public String getTitle(String languageId) {
    return LocalizationUtil.getLocalization(getTitle(), languageId);
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public String getTitle(String languageId, boolean useDefault) {
    return LocalizationUtil.getLocalization(getTitle(), languageId,
        useDefault);
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public Map<Locale, String> getTitleMap() {
    return LocalizationUtil.getLocalizationMap(getTitle());
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public String getDescription(String languageId) {
    return LocalizationUtil.getLocalization(getDescription(), languageId);
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public String getDescription(String languageId, boolean useDefault) {
    return LocalizationUtil.getLocalization(getDescription(), languageId,
        useDefault);
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public Map<Locale, String> getDescriptionMap() {
    return LocalizationUtil.getLocalizationMap(getDescription());
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public String getDiplomaTemplate(String languageId) {
    return LocalizationUtil.getLocalization(getDiplomaTemplate(), languageId);
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public String getDiplomaTemplate(String languageId, boolean useDefault) {
    return LocalizationUtil.getLocalization(getDiplomaTemplate(),
        languageId, useDefault);
}
项目:liferaylms-portlet    文件:CompetenceClp.java   
public Map<Locale, String> getDiplomaTemplateMap() {
    return LocalizationUtil.getLocalizationMap(getDiplomaTemplate());
}
项目:liferaylms-portlet    文件:ModuleClp.java   
public String getTitle(String languageId) {
    return LocalizationUtil.getLocalization(getTitle(), languageId);
}
项目:liferaylms-portlet    文件:ModuleClp.java   
public String getTitle(String languageId, boolean useDefault) {
    return LocalizationUtil.getLocalization(getTitle(), languageId,
        useDefault);
}
项目:liferaylms-portlet    文件:ModuleClp.java   
public Map<Locale, String> getTitleMap() {
    return LocalizationUtil.getLocalizationMap(getTitle());
}