1 package be
.nikiroo
.fanfix
.bundles
;
3 import java
.io
.IOException
;
6 import be
.nikiroo
.utils
.resources
.Bundle
;
7 import be
.nikiroo
.utils
.resources
.Meta
;
10 * The {@link Enum} representing textual information to be translated to the
13 * Note that each key that should be translated <b>must</b> be annotated with a
14 * {@link Meta} annotation.
18 @SuppressWarnings("javadoc")
19 public enum StringId
{
21 * A special key used for technical reasons only, without annotations so it
22 * is not visible in <tt>.properties</tt> files.
24 * Use it when you need NO translation.
28 * A special key used for technical reasons only, without annotations so it
29 * is not visible in <tt>.properties</tt> files.
31 * Use it when you need a real translation but still don't have a key.
34 @Meta(info
= "%s = supported input, %s = supported output", description
= "help message for the syntax")
36 @Meta(description
= "syntax error message")
38 @Meta(info
= "%s = support name, %s = support desc", description
= "an input or output support type description")
40 @Meta(info
= "%s = input string", description
= "Error when retrieving data")
42 @Meta(info
= "%s = save target", description
= "Error when saving to given target")
44 @Meta(info
= "%s = bad output format", description
= "Error when unknown output format")
45 ERR_BAD_OUTPUT_TYPE
, //
46 @Meta(info
= "%s = input string", description
= "Error when converting input to URL/File")
48 @Meta(info
= "%s = input url", description
= "URL/File not supported")
50 @Meta(info
= "%s = cover URL", description
= "Failed to download cover : %s")
52 @Meta(def
= "`", info
= "single char", description
= "Canonical OPEN SINGLE QUOTE char (for instance: ‘)")
54 @Meta(def
= "‘", info
= "single char", description
= "Canonical CLOSE SINGLE QUOTE char (for instance: ’)")
55 CLOSE_SINGLE_QUOTE
, //
56 @Meta(def
= "“", info
= "single char", description
= "Canonical OPEN DOUBLE QUOTE char (for instance: “)")
58 @Meta(def
= "”", info
= "single char", description
= "Canonical CLOSE DOUBLE QUOTE char (for instance: ”)")
59 CLOSE_DOUBLE_QUOTE
, //
60 @Meta(def
= "Description", description
= "Name of the description fake chapter")
62 @Meta(def
= "Chapter %d: %s", info
= "%d = number, %s = name", description
= "Name of a chapter with a name")
64 @Meta(def
= "Chapter %d", info
= "%d = number, %s = name", description
= "Name of a chapter without name")
66 @Meta(info
= "%s = type", description
= "Default description when the type is not known by i18n")
68 @Meta(description
= "Description of this input type")
70 @Meta(description
= "Description of this input type")
72 @Meta(description
= "Description of this input type")
73 INPUT_DESC_INFO_TEXT
, //
74 @Meta(description
= "Description of this input type")
75 INPUT_DESC_FANFICTION
, //
76 @Meta(description
= "Description of this input type")
77 INPUT_DESC_FIMFICTION
, //
78 @Meta(description
= "Description of this input type")
79 INPUT_DESC_MANGAFOX
, //
80 @Meta(description
= "Description of this input type")
82 @Meta(description
= "Description of this input type")
83 INPUT_DESC_E_HENTAI
, //
84 @Meta(description
= "Description of this input type")
85 INPUT_DESC_YIFFSTAR
, //
86 @Meta(description
= "Description of this input type")
88 @Meta(description
= "Description of this input type")
90 @Meta(info
= "%s = type", description
= "Default description when the type is not known by i18n")
92 @Meta(description
= "Description of this output type")
94 @Meta(description
= "Description of this output type")
96 @Meta(description
= "Description of this output type")
97 OUTPUT_DESC_INFO_TEXT
, //
98 @Meta(description
= "Description of this output type")
100 @Meta(description
= "Description of this output type")
102 @Meta(description
= "Description of this output type")
103 OUTPUT_DESC_LATEX
, //
104 @Meta(description
= "Description of this output type")
105 OUTPUT_DESC_SYSOUT
, //
106 @Meta(group
= true, info
= "%s = type", description
= "Default description when the type is not known by i18n")
107 OUTPUT_DESC_SHORT
, //
108 @Meta(description
= "Short description of this output type")
109 OUTPUT_DESC_SHORT_EPUB
, //
110 @Meta(description
= "Short description of this output type")
111 OUTPUT_DESC_SHORT_TEXT
, //
112 @Meta(description
= "Short description of this output type")
113 OUTPUT_DESC_SHORT_INFO_TEXT
, //
114 @Meta(description
= "Short description of this output type")
115 OUTPUT_DESC_SHORT_CBZ
, //
116 @Meta(description
= "Short description of this output type")
117 OUTPUT_DESC_SHORT_LATEX
, //
118 @Meta(description
= "Short description of this output type")
119 OUTPUT_DESC_SHORT_SYSOUT
, //
120 @Meta(description
= "Short description of this output type")
121 OUTPUT_DESC_SHORT_HTML
, //
122 @Meta(info
= "%s = the unknown 2-code language", description
= "Error message for unknown 2-letter LaTeX language code")
123 LATEX_LANG_UNKNOWN
, //
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")
130 * Write the header found in the configuration <tt>.properties</tt> file of
131 * this {@link Bundle}.
134 * the {@link Writer} to write the header in
138 * @throws IOException
139 * in case of IO error
141 static public void writeHeader(Writer writer
, String name
)
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");