Merge branch 'subtree'
[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, //
15c6c51e 52 @Meta(def = "`", info = "single char", description = "Canonical OPEN SINGLE QUOTE char (for instance: ‘)")
08fe2e33 53 OPEN_SINGLE_QUOTE, //
15c6c51e 54 @Meta(def = "‘", info = "single char", description = "Canonical CLOSE SINGLE QUOTE char (for instance: ’)")
08fe2e33 55 CLOSE_SINGLE_QUOTE, //
ae78e517 56 @Meta(def = "“", info = "single char", description = "Canonical OPEN DOUBLE QUOTE char (for instance: “)")
08fe2e33 57 OPEN_DOUBLE_QUOTE, //
ae78e517 58 @Meta(def = "”", info = "single char", description = "Canonical CLOSE DOUBLE QUOTE char (for instance: ”)")
08fe2e33 59 CLOSE_DOUBLE_QUOTE, //
ae78e517 60 @Meta(def = "Description", description = "Name of the description fake chapter")
08fe2e33 61 DESCRIPTION, //
ae78e517 62 @Meta(def = "Chapter %d: %s", info = "%d = number, %s = name", description = "Name of a chapter with a name")
08fe2e33 63 CHAPTER_NAMED, //
ae78e517 64 @Meta(def = "Chapter %d", 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, //
99ccbdf6
NR
84 @Meta(description = "Description of this input type")
85 INPUT_DESC_YIFFSTAR, //
86 @Meta(description = "Description of this input type")
87 INPUT_DESC_CBZ, //
88 @Meta(description = "Description of this input type")
89 INPUT_DESC_HTML, //
ce788468 90 @Meta(info = "%s = type", description = "Default description when the type is not known by i18n")
08fe2e33 91 OUTPUT_DESC, //
ce788468 92 @Meta(description = "Description of this output type")
08fe2e33 93 OUTPUT_DESC_EPUB, //
ce788468 94 @Meta(description = "Description of this output type")
08fe2e33 95 OUTPUT_DESC_TEXT, //
ce788468 96 @Meta(description = "Description of this output type")
08fe2e33 97 OUTPUT_DESC_INFO_TEXT, //
ce788468 98 @Meta(description = "Description of this output type")
08fe2e33 99 OUTPUT_DESC_CBZ, //
ce788468 100 @Meta(description = "Description of this output type")
b2612f9d 101 OUTPUT_DESC_HTML, //
ce788468 102 @Meta(description = "Description of this output type")
08fe2e33 103 OUTPUT_DESC_LATEX, //
ce788468 104 @Meta(description = "Description of this output type")
08fe2e33 105 OUTPUT_DESC_SYSOUT, //
ce788468 106 @Meta(group = true, info = "%s = type", description = "Default description when the type is not known by i18n")
4d205683 107 OUTPUT_DESC_SHORT, //
ce788468 108 @Meta(description = "Short description of this output type")
4d205683 109 OUTPUT_DESC_SHORT_EPUB, //
ce788468 110 @Meta(description = "Short description of this output type")
4d205683 111 OUTPUT_DESC_SHORT_TEXT, //
ce788468 112 @Meta(description = "Short description of this output type")
4d205683 113 OUTPUT_DESC_SHORT_INFO_TEXT, //
ce788468 114 @Meta(description = "Short description of this output type")
4d205683 115 OUTPUT_DESC_SHORT_CBZ, //
ce788468 116 @Meta(description = "Short description of this output type")
4d205683 117 OUTPUT_DESC_SHORT_LATEX, //
ce788468 118 @Meta(description = "Short description of this output type")
4d205683 119 OUTPUT_DESC_SHORT_SYSOUT, //
ce788468 120 @Meta(description = "Short description of this output type")
b2612f9d 121 OUTPUT_DESC_SHORT_HTML, //
ce788468 122 @Meta(info = "%s = the unknown 2-code language", description = "Error message for unknown 2-letter LaTeX language code")
08fe2e33 123 LATEX_LANG_UNKNOWN, //
ae78e517 124 @Meta(def = "by", description = "'by' prefix before author name used to output the author, make sure it is covered by Config.BYS for input detection")
08fe2e33
NR
125 BY, //
126
127 ;
128
129 /**
130 * Write the header found in the configuration <tt>.properties</tt> file of
131 * this {@link Bundle}.
132 *
133 * @param writer
134 * the {@link Writer} to write the header in
135 * @param name
136 * the file name
137 *
138 * @throws IOException
139 * in case of IO error
140 */
141 static public void writeHeader(Writer writer, String name)
142 throws IOException {
143 writer.write("# " + name + " translation file (UTF-8)\n");
144 writer.write("# \n");
145 writer.write("# Note that any key can be doubled with a _NOUTF suffix\n");
146 writer.write("# to use when the NOUTF env variable is set to 1\n");
147 writer.write("# \n");
148 writer.write("# Also, the comments always refer to the key below them.\n");
149 writer.write("# \n");
150 }
211f7ddb 151}