/** * Returns a localised description for a pack. * <p/> * This uses {@code "<langPackId>.description"} to locate the localised name for the pack. * <p/> * If no localised description exists, {@link Pack#getDescription()} wil be returned. * * @param pack the pack * @param messages the messages. May be {@code null} * @return the pack description. May be {@code null} */ public static String getPackDescription(Pack pack, Messages messages) { String result = null; if (messages != null && pack.getLangPackId() != null) { result = getMessage(pack.getLangPackId() + ".description", messages); } if (result == null) { result = pack.getDescription(); } return result; }
/** * Returns a localised name for a pack. * <p/> * This uses {@link Pack#getLangPackId()} to locate the localised name for the pack. * <p/> * If no localised name exists, {@link Pack#getName()} will be returned. * * @param pack the pack * @param messages the messages. May be {@code null} * @return the pack name */ public static String getPackName(Pack pack, Messages messages) { String name = null; if (messages != null) { name = getMessage(pack.getLangPackId(), messages); } if (name == null || "".equals(name)) { name = pack.getName(); } return name; }
child.setAttribute("size", Long.toString(pack.getSize())); child.setAttribute("fileSize", Long.toString(pack.getFileSize())); if (pack.getLangPackId() != null) child.setAttribute("id", pack.getLangPackId());