39cb0b239f4d9df67c276881e0efa2fe433efff7
1 package be
.nikiroo
.fanfix
.bundles
;
3 import java
.io
.IOException
;
6 import be
.nikiroo
.utils
.resources
.Meta
;
7 import be
.nikiroo
.utils
.resources
.bundles
.Bundle
;
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 public enum StringId
{
20 * A special key used for technical reasons only, without annotations so it
21 * is not visible in <tt>.properties</tt> files.
23 * Use it when you need NO translation.
27 * A special key used for technical reasons only, without annotations so it
28 * is not visible in <tt>.properties</tt> files.
30 * Use it when you need a real translation but still don't have a key.
33 @Meta(what
= "error message", where
= "cli", format
= "%s = supported input, %s = supported output", info
= "syntax error message")
35 @Meta(what
= "error message", where
= "cli", format
= "%s = support name, %s = support desc", info
= "an input or output support type description")
37 @Meta(what
= "error message", where
= "cli", format
= "%s = input string", info
= "Error when retrieving data")
39 @Meta(what
= "error message", where
= "cli", format
= "%s = save target", info
= "Error when saving to given target")
41 @Meta(what
= "error message", where
= "cli", format
= "%s = bad output format", info
= "Error when unknown output format")
42 ERR_BAD_OUTPUT_TYPE
, //
43 @Meta(what
= "error message", where
= "cli", format
= "%s = input string", info
= "Error when converting input to URL/File")
45 @Meta(what
= "error message", where
= "cli", format
= "%s = input url", info
= "URL/File not supported")
47 @Meta(what
= "error message", where
= "BasicSupport", format
= "%s = cover URL", info
= "Failed to download cover : %s")
49 @Meta(what
= "char", where
= "LaTeX/BasicSupport", format
= "single char", info
= "Canonical OPEN SINGLE QUOTE char (for instance: `)")
51 @Meta(what
= "char", where
= "LaTeX/BasicSupport", format
= "single char", info
= "Canonical CLOSE SINGLE QUOTE char (for instance: ‘)")
52 CLOSE_SINGLE_QUOTE
, //
53 @Meta(what
= "char", where
= "LaTeX/BasicSupport", format
= "single char", info
= "Canonical OPEN DOUBLE QUOTE char (for instance: “)")
55 @Meta(what
= "char", where
= "LaTeX/BasicSupport", format
= "single char", info
= "Canonical CLOSE DOUBLE QUOTE char (for instance: ”)")
56 CLOSE_DOUBLE_QUOTE
, //
57 @Meta(what
= "chapter name", where
= "BasicSupport", format
= "", info
= "Name of the description fake chapter")
59 @Meta(what
= "chapter name", where
= "", format
= "%d = number, %s = name", info
= "Name of a chapter with a name")
61 @Meta(what
= "chapter name", where
= "", format
= "%d = number, %s = name", info
= "Name of a chapter without name")
63 @Meta(what
= "input format description", where
= "SupportType", format
= "%s = type", info
= "Default description when the type is not known by i18n")
65 @Meta(what
= "input format description", where
= "SupportType", format
= "", info
= "Description of this input type")
67 @Meta(what
= "input format description", where
= "SupportType", format
= "", info
= "Description of this input type")
69 @Meta(what
= "input format description", where
= "SupportType", format
= "", info
= "Description of this input type")
70 INPUT_DESC_INFO_TEXT
, //
71 @Meta(what
= "input format description", where
= "SupportType", format
= "", info
= "Description of this input type")
72 INPUT_DESC_FANFICTION
, //
73 @Meta(what
= "input format description", where
= "SupportType", format
= "", info
= "Description of this input type")
74 INPUT_DESC_FIMFICTION
, //
75 @Meta(what
= "input format description", where
= "SupportType", format
= "", info
= "Description of this input type")
76 INPUT_DESC_MANGAFOX
, //
77 @Meta(what
= "input format description", where
= "SupportType", format
= "", info
= "Description of this input type")
79 @Meta(what
= "output format description", where
= "OutputType", format
= "%s = type", info
= "Default description when the type is not known by i18n")
81 @Meta(what
= "output format description", where
= "OutputType", format
= "", info
= "Description of this output type")
83 @Meta(what
= "output format description", where
= "OutputType", format
= "", info
= "Description of this output type")
85 @Meta(what
= "output format description", where
= "OutputType", format
= "", info
= "Description of this output type")
86 OUTPUT_DESC_INFO_TEXT
, //
87 @Meta(what
= "output format description", where
= "OutputType", format
= "", info
= "Description of this output type")
89 @Meta(what
= "output format description", where
= "OutputType", format
= "", info
= "Description of this output type")
91 @Meta(what
= "output format description", where
= "OutputType", format
= "", info
= "Description of this output type")
92 OUTPUT_DESC_SYSOUT
, //
93 @Meta(what
= "error message", where
= "LaTeX", format
= "%s = the unknown 2-code language", info
= "Error message for unknown 2-letter LaTeX language code")
94 LATEX_LANG_UNKNOWN
, //
95 @Meta(what
= "'by' prefix before author name", where
= "", format
= "", info
= "used to output the author, make sure it is covered by Config.BYS for input detection")
101 * Write the header found in the configuration <tt>.properties</tt> file of
102 * this {@link Bundle}.
105 * the {@link Writer} to write the header in
109 * @throws IOException
110 * in case of IO error
112 static public void writeHeader(Writer writer
, String name
)
114 writer
.write("# " + name
+ " translation file (UTF-8)\n");
115 writer
.write("# \n");
116 writer
.write("# Note that any key can be doubled with a _NOUTF suffix\n");
117 writer
.write("# to use when the NOUTF env variable is set to 1\n");
118 writer
.write("# \n");
119 writer
.write("# Also, the comments always refer to the key below them.\n");
120 writer
.write("# \n");