import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Paragraph.ParagraphType;
import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.utils.ui.Progress;
+import be.nikiroo.utils.Progress;
/**
* This class is the base class used by the other output classes. It can be used
/**
* A description of this output type.
*
+ * @param longDesc
+ * TRUE for the long description, FALSE for the short one
+ *
* @return the description
*/
- public String getDesc() {
- String desc = Instance.getTrans().getStringX(StringId.OUTPUT_DESC,
- this.name());
+ public String getDesc(boolean longDesc) {
+ StringId id = longDesc ? StringId.OUTPUT_DESC
+ : StringId.OUTPUT_DESC_SHORT;
+
+ String desc = Instance.getTrans().getStringX(id, this.name());
if (desc == null) {
- desc = Instance.getTrans()
- .getString(StringId.OUTPUT_DESC, this);
+ desc = Instance.getTrans().getString(id, this);
}
return desc;
/**
* The default extension to add to the output files.
*
+ * @param readerTarget
+ * the target to point to to read the {@link Story} (for
+ * instance, the main entry point if this {@link Story} is in
+ * a directory bundle)
+ *
* @return the extension
*/
- public String getDefaultExtension() {
+ public String getDefaultExtension(boolean readerTarget) {
BasicOutput output = BasicOutput.getOutput(this, false);
if (output != null) {
- return output.getDefaultExtension();
+ return output.getDefaultExtension(readerTarget);
}
return null;
File targetDir = new File(target).getParentFile();
String targetName = new File(target).getName();
- String ext = getDefaultExtension();
+ String ext = getDefaultExtension(false);
if (ext != null && !ext.isEmpty()) {
if (targetName.toLowerCase().endsWith(ext)) {
targetName = targetName.substring(0,
/**
* The default extension to add to the output files.
*
+ * @param readerTarget
+ * the target to point to to read the {@link Story} (for
+ * instance, the main entry point if this {@link Story} is in a
+ * directory bundle)
+ *
* @return the extension
*/
- public String getDefaultExtension() {
+ public String getDefaultExtension(boolean readerTarget) {
return "";
}