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(info
= "single char", description
= "Canonical OPEN SINGLE QUOTE char (for instance: `)")
54 @Meta(info
= "single char", description
= "Canonical CLOSE SINGLE QUOTE char (for instance: ‘)")
55 CLOSE_SINGLE_QUOTE
, //
56 @Meta(info
= "single char", description
= "Canonical OPEN DOUBLE QUOTE char (for instance: “)")
58 @Meta(info
= "single char", description
= "Canonical CLOSE DOUBLE QUOTE char (for instance: ”)")
59 CLOSE_DOUBLE_QUOTE
, //
60 @Meta(description
= "Name of the description fake chapter")
62 @Meta(info
= "%d = number, %s = name", description
= "Name of a chapter with a name")
64 @Meta(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(info
= "%s = type", description
= "Default description when the type is not known by i18n")
86 @Meta(description
= "Description of this output type")
88 @Meta(description
= "Description of this output type")
90 @Meta(description
= "Description of this output type")
91 OUTPUT_DESC_INFO_TEXT
, //
92 @Meta(description
= "Description of this output type")
94 @Meta(description
= "Description of this output type")
96 @Meta(description
= "Description of this output type")
98 @Meta(description
= "Description of this output type")
99 OUTPUT_DESC_SYSOUT
, //
100 @Meta(group
= true, info
= "%s = type", description
= "Default description when the type is not known by i18n")
101 OUTPUT_DESC_SHORT
, //
102 @Meta(description
= "Short description of this output type")
103 OUTPUT_DESC_SHORT_EPUB
, //
104 @Meta(description
= "Short description of this output type")
105 OUTPUT_DESC_SHORT_TEXT
, //
106 @Meta(description
= "Short description of this output type")
107 OUTPUT_DESC_SHORT_INFO_TEXT
, //
108 @Meta(description
= "Short description of this output type")
109 OUTPUT_DESC_SHORT_CBZ
, //
110 @Meta(description
= "Short description of this output type")
111 OUTPUT_DESC_SHORT_LATEX
, //
112 @Meta(description
= "Short description of this output type")
113 OUTPUT_DESC_SHORT_SYSOUT
, //
114 @Meta(description
= "Short description of this output type")
115 OUTPUT_DESC_SHORT_HTML
, //
116 @Meta(info
= "%s = the unknown 2-code language", description
= "Error message for unknown 2-letter LaTeX language code")
117 LATEX_LANG_UNKNOWN
, //
118 @Meta(description
= "'by' prefix before author name used to output the author, make sure it is covered by Config.BYS for input detection")
124 * Write the header found in the configuration <tt>.properties</tt> file of
125 * this {@link Bundle}.
128 * the {@link Writer} to write the header in
132 * @throws IOException
133 * in case of IO error
135 static public void writeHeader(Writer writer
, String name
)
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");