Fix source/type reset on redownload, show num img
[fanfix.git] / src / be / nikiroo / fanfix / bundles / StringId.java
CommitLineData
08fe2e33
NR
1package be.nikiroo.fanfix.bundles;
2
3import java.io.IOException;
4import java.io.Writer;
5
948637bc 6import be.nikiroo.utils.resources.Bundle;
08fe2e33 7import be.nikiroo.utils.resources.Meta;
08fe2e33
NR
8
9/**
10 * The {@link Enum} representing textual information to be translated to the
11 * user as a key.
12 *
13 * Note that each key that should be translated <b>must</b> be annotated with a
14 * {@link Meta} annotation.
15 *
16 * @author niki
17 */
ce788468 18@SuppressWarnings("javadoc")
08fe2e33
NR
19public enum StringId {
20 /**
21 * A special key used for technical reasons only, without annotations so it
22 * is not visible in <tt>.properties</tt> files.
23 * <p>
24 * Use it when you need NO translation.
25 */
26 NULL, //
27 /**
28 * A special key used for technical reasons only, without annotations so it
29 * is not visible in <tt>.properties</tt> files.
30 * <p>
31 * Use it when you need a real translation but still don't have a key.
32 */
33 DUMMY, //
ce788468 34 @Meta(info = "%s = supported input, %s = supported output", description = "help message for the syntax")
d0114000 35 HELP_SYNTAX, //
ce788468 36 @Meta(description = "syntax error message")
08fe2e33 37 ERR_SYNTAX, //
ce788468 38 @Meta(info = "%s = support name, %s = support desc", description = "an input or output support type description")
08fe2e33 39 ERR_SYNTAX_TYPE, //
ce788468 40 @Meta(info = "%s = input string", description = "Error when retrieving data")
08fe2e33 41 ERR_LOADING, //
ce788468 42 @Meta(info = "%s = save target", description = "Error when saving to given target")
08fe2e33 43 ERR_SAVING, //
ce788468 44 @Meta(info = "%s = bad output format", description = "Error when unknown output format")
08fe2e33 45 ERR_BAD_OUTPUT_TYPE, //
ce788468 46 @Meta(info = "%s = input string", description = "Error when converting input to URL/File")
08fe2e33 47 ERR_BAD_URL, //
ce788468 48 @Meta(info = "%s = input url", description = "URL/File not supported")
08fe2e33 49 ERR_NOT_SUPPORTED, //
ce788468 50 @Meta(info = "%s = cover URL", description = "Failed to download cover : %s")
08fe2e33 51 ERR_BS_NO_COVER, //
ce788468 52 @Meta(info = "single char", description = "Canonical OPEN SINGLE QUOTE char (for instance: `)")
08fe2e33 53 OPEN_SINGLE_QUOTE, //
ce788468 54 @Meta(info = "single char", description = "Canonical CLOSE SINGLE QUOTE char (for instance: ‘)")
08fe2e33 55 CLOSE_SINGLE_QUOTE, //
ce788468 56 @Meta(info = "single char", description = "Canonical OPEN DOUBLE QUOTE char (for instance: “)")
08fe2e33 57 OPEN_DOUBLE_QUOTE, //
ce788468 58 @Meta(info = "single char", description = "Canonical CLOSE DOUBLE QUOTE char (for instance: ”)")
08fe2e33 59 CLOSE_DOUBLE_QUOTE, //
ce788468 60 @Meta(description = "Name of the description fake chapter")
08fe2e33 61 DESCRIPTION, //
ce788468 62 @Meta(info = "%d = number, %s = name", description = "Name of a chapter with a name")
08fe2e33 63 CHAPTER_NAMED, //
ce788468 64 @Meta(info = "%d = number, %s = name", description = "Name of a chapter without name")
08fe2e33 65 CHAPTER_UNNAMED, //
ce788468 66 @Meta(info = "%s = type", description = "Default description when the type is not known by i18n")
08fe2e33 67 INPUT_DESC, //
ce788468 68 @Meta(description = "Description of this input type")
08fe2e33 69 INPUT_DESC_EPUB, //
ce788468 70 @Meta(description = "Description of this input type")
08fe2e33 71 INPUT_DESC_TEXT, //
ce788468 72 @Meta(description = "Description of this input type")
08fe2e33 73 INPUT_DESC_INFO_TEXT, //
ce788468 74 @Meta(description = "Description of this input type")
08fe2e33 75 INPUT_DESC_FANFICTION, //
ce788468 76 @Meta(description = "Description of this input type")
08fe2e33 77 INPUT_DESC_FIMFICTION, //
ce788468 78 @Meta(description = "Description of this input type")
08fe2e33 79 INPUT_DESC_MANGAFOX, //
ce788468 80 @Meta(description = "Description of this input type")
08fe2e33 81 INPUT_DESC_E621, //
ce788468 82 @Meta(description = "Description of this input type")
f0608ab1 83 INPUT_DESC_E_HENTAI, //
ce788468 84 @Meta(info = "%s = type", description = "Default description when the type is not known by i18n")
08fe2e33 85 OUTPUT_DESC, //
ce788468 86 @Meta(description = "Description of this output type")
08fe2e33 87 OUTPUT_DESC_EPUB, //
ce788468 88 @Meta(description = "Description of this output type")
08fe2e33 89 OUTPUT_DESC_TEXT, //
ce788468 90 @Meta(description = "Description of this output type")
08fe2e33 91 OUTPUT_DESC_INFO_TEXT, //
ce788468 92 @Meta(description = "Description of this output type")
08fe2e33 93 OUTPUT_DESC_CBZ, //
ce788468 94 @Meta(description = "Description of this output type")
b2612f9d 95 OUTPUT_DESC_HTML, //
ce788468 96 @Meta(description = "Description of this output type")
08fe2e33 97 OUTPUT_DESC_LATEX, //
ce788468 98 @Meta(description = "Description of this output type")
08fe2e33 99 OUTPUT_DESC_SYSOUT, //
ce788468 100 @Meta(group = true, info = "%s = type", description = "Default description when the type is not known by i18n")
4d205683 101 OUTPUT_DESC_SHORT, //
ce788468 102 @Meta(description = "Short description of this output type")
4d205683 103 OUTPUT_DESC_SHORT_EPUB, //
ce788468 104 @Meta(description = "Short description of this output type")
4d205683 105 OUTPUT_DESC_SHORT_TEXT, //
ce788468 106 @Meta(description = "Short description of this output type")
4d205683 107 OUTPUT_DESC_SHORT_INFO_TEXT, //
ce788468 108 @Meta(description = "Short description of this output type")
4d205683 109 OUTPUT_DESC_SHORT_CBZ, //
ce788468 110 @Meta(description = "Short description of this output type")
4d205683 111 OUTPUT_DESC_SHORT_LATEX, //
ce788468 112 @Meta(description = "Short description of this output type")
4d205683 113 OUTPUT_DESC_SHORT_SYSOUT, //
ce788468 114 @Meta(description = "Short description of this output type")
b2612f9d 115 OUTPUT_DESC_SHORT_HTML, //
ce788468 116 @Meta(info = "%s = the unknown 2-code language", description = "Error message for unknown 2-letter LaTeX language code")
08fe2e33 117 LATEX_LANG_UNKNOWN, //
ce788468 118 @Meta(description = "'by' prefix before author name used to output the author, make sure it is covered by Config.BYS for input detection")
08fe2e33
NR
119 BY, //
120
121 ;
122
123 /**
124 * Write the header found in the configuration <tt>.properties</tt> file of
125 * this {@link Bundle}.
126 *
127 * @param writer
128 * the {@link Writer} to write the header in
129 * @param name
130 * the file name
131 *
132 * @throws IOException
133 * in case of IO error
134 */
135 static public void writeHeader(Writer writer, String name)
136 throws IOException {
137 writer.write("# " + name + " translation file (UTF-8)\n");
138 writer.write("# \n");
139 writer.write("# Note that any key can be doubled with a _NOUTF suffix\n");
140 writer.write("# to use when the NOUTF env variable is set to 1\n");
141 writer.write("# \n");
142 writer.write("# Also, the comments always refer to the key below them.\n");
143 writer.write("# \n");
144 }
211f7ddb 145}