1 package be
.nikiroo
.jvcard
.resources
.enums
;
3 import java
.io
.IOException
;
6 import be
.nikiroo
.jvcard
.resources
.Bundles
.Bundle
;
7 import be
.nikiroo
.jvcard
.resources
.Meta
;
10 * The enum representing textual information to be translated to the user as a
13 * Note that each key that should be translated MUST be annotated with a
14 * {@link Meta} annotation.
19 public enum StringId
{
20 DUMMY
, // <-- TODO : remove
21 NULL
, // Special usage, no annotations so it is not visible in
23 @Meta(what
= "a key to press", where
= "action keys", format
= "MUST BE 3 chars long", info
= "Tab key")
25 @Meta(what
= "a key to press", where
= "action keys", format
= "MUST BE 3 chars long", info
= "Enter key")
27 @Meta(what
= "Action key", where
= "All screens except the first (KEY_ACTION_QUIT)", format
= "", info
= "Go back to previous screen")
29 @Meta(what
= "Action key", where
= "MainWindow", format
= "", info
= "Get help text")
31 @Meta(what
= "Action key", where
= "FileList", format
= "", info
= "View the selected card")
32 KEY_ACTION_VIEW_CARD
, //
33 @Meta(what
= "Action key", where
= "ContactList", format
= "", info
= "View the selected contact")
34 KEY_ACTION_VIEW_CONTACT
, //
35 @Meta(what
= "Action key", where
= "ContactDetails", format
= "", info
= "Edit the contact")
36 KEY_ACTION_EDIT_CONTACT
, //
37 @Meta(what
= "Action key", where
= "ContactDetails", format
= "", info
= "Edit the contact in RAW mode")
38 KEY_ACTION_EDIT_CONTACT_RAW
, //
39 @Meta(what
= "Action key", where
= "ContactDetailsRaw", format
= "", info
= "Edit the RAW field")
40 KEY_ACTION_EDIT_FIELD
, //
41 @Meta(what
= "Action key", where
= "ContactList", format
= "", info
= "Save the whole card")
42 KEY_ACTION_SAVE_CARD
, //
43 @Meta(what
= "", where
= "ContactList/ContactDetailsRaw", format
= "", info
= "Delete the selected element")
45 @Meta(what
= "Action key", where
= "ContactList", format
= "", info
= "Filter the displayed contacts")
47 @Meta(what
= "", where
= "", format
= "we could use: ' ', ┃, │...", info
= "Field separator")
48 DEAULT_FIELD_SEPARATOR
, // MainContentList
49 @Meta(what
= "Action key", where
= "ContactDetails", format
= "", info
= "Invert the photo's colours")
51 @Meta(what
= "Action key", where
= "ContactDetails", format
= "", info
= "Show the photo in 'fullscreen'")
52 KEY_ACTION_FULLSCREEN
, //
53 @Meta(what
= "Action key", where
= "ContactList, ContactDetails, ContactDetailsRaw", format
= "", info
= "Switch between the available display formats")
54 KEY_ACTION_SWITCH_FORMAT
, // multi-usage
55 @Meta(what
= "Action key", where
= "Contact list, Edit Contact", format
= "", info
= "Add a new contact/field")
57 @Meta(what
= "User question: TEXT", where
= "Contact list", format
= "", info
= "New contact")
58 ASK_USER_CONTACT_NAME
, //
59 @Meta(what
= "User question: [Y|N]", where
= "Contact list", format
= "%s = contact name", info
= "Delete contact")
60 CONFIRM_USER_DELETE_CONTACT
, //
61 @Meta(what
= "Error", where
= "Contact list", format
= "%s = contact name", info
= "cannot delete a contact")
62 ERR_CANNOT_DELETE_CONTACT
, //
63 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message header line")
65 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line before explaining the different modes")
67 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for help usage")
68 CLI_HELP_MODE_HELP
, //
69 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for contact manager usage")
70 CLI_HELP_MODE_CONTACT_MANAGER
, //
71 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for contact manager usage")
72 CLI_HELP_MODE_I18N
, //
73 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for jVCard server usage")
74 CLI_HELP_MODE_SERVER
, //
75 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for --load-photo usage")
76 CLI_HELP_MODE_LOAD_PHOTO
, //
77 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for --save-photo usage")
78 CLI_HELP_MODE_SAVE_PHOTO
, //
79 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for config save usage")
80 CLI_HELP_MODE_SAVE_CONFIG
, //
81 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line before the list of options")
83 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for: --")
85 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for: --")
87 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for: --")
89 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for: --")
91 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for: --")
93 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message line for: --")
95 @Meta(what
= "CLI --help", where
= "", format
= "", info
= "The Help message footer about files and jvcard:// links")
97 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = the error", info
= "Syntax error: SOME TEXT")
99 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "More than one mode given")
101 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "--lang is required")
103 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "The dir is required")
105 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "The port is required")
107 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "The format is required")
108 CLI_SERR_NOFORMAT
, //
109 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = bad port", info
= "The port is not valid")
111 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = mode", info
= "Card files are not supported in mode %s")
112 CLI_SERR_CANNOT_CARDS
, //
113 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = the error", info
= "Error: SOME TEXT")
115 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "No files given")
117 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = dir", info
= "Cannot create conf dir %s")
118 CLI_ERR_CANNOT_CREATE_CONFDIR
, //
119 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "Remoting not available")
120 CLI_ERR_NO_REMOTING
, //
121 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "TUI not available")
123 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = dir", info
= "Cannot create/update language in dir %s")
124 CLI_ERR_CANNOT_CREATE_LANG
, //
125 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = card", info
= "Cannot open card %s")
126 CLI_ERR_CANNOT_OPEN
, //
127 @Meta(what
= "CLI ERROR", where
= "", format
= "%s = contact FN", info
= "Cannot save photo of contact %s")
128 CLI_ERR_CANNOT_SAVE_PHOTO
, //
129 @Meta(what
= "CLI ERROR", where
= "", format
= "", info
= "Cannot start the program with the given cards")
130 CLI_ERR_CANNOT_START
, //
135 * Write the header found in the configuration <tt>.properties</tt> file of
136 * this {@link Bundle}.
139 * the {@link Writer} to write the header in
143 * @throws IOException
144 * in case of IO error
146 static public void writeHeader(Writer writer
, String name
)
148 writer
.write("# " + name
+ " translation file (UTF-8)\n");
149 writer
.write("# \n");
150 writer
.write("# Note that any key can be doubled with a _NOUTF suffix\n");
151 writer
.write("# to use when the flag --noutf is passed\n");
152 writer
.write("# \n");
153 writer
.write("# Also, the comments always refer to the key below them.\n");
154 writer
.write("# \n");