package be.nikiroo.jvcard.resources.enums; import java.io.IOException; import java.io.Writer; import be.nikiroo.jvcard.resources.Bundles.Bundle; import be.nikiroo.jvcard.resources.Meta; /** * The enum representing textual information to be translated to the user as a * key. * * Note that each key that should be translated MUST be annotated with a * {@link Meta} annotation. * * @author niki * */ public enum StringId { DUMMY, // <-- TODO : remove NULL, // Special usage, no annotations so it is not visible in // .properties files @Meta(what = "a key to press", where = "action keys", format = "MUST BE 3 chars long", info = "Tab key") KEY_TAB, // keys @Meta(what = "a key to press", where = "action keys", format = "MUST BE 3 chars long", info = "Enter key") KEY_ENTER, // @Meta(what = "Action key", where = "All screens except the first (KEY_ACTION_QUIT)", format = "", info = "Go back to previous screen") KEY_ACTION_BACK, // @Meta(what = "Action key", where = "MainWindow", format = "", info = "Get help text") KEY_ACTION_HELP, // @Meta(what = "Action key", where = "FileList", format = "", info = "View the selected card") KEY_ACTION_VIEW_CARD, // @Meta(what = "Action key", where = "ContactList", format = "", info = "View the selected contact") KEY_ACTION_VIEW_CONTACT, // @Meta(what = "Action key", where = "ContactDetails", format = "", info = "Edit the contact") KEY_ACTION_EDIT_CONTACT, // @Meta(what = "Action key", where = "ContactDetails", format = "", info = "Edit the contact in RAW mode") KEY_ACTION_EDIT_CONTACT_RAW, // @Meta(what = "Action key", where = "ContactList", format = "", info = "Save the whole card") KEY_ACTION_SAVE_CARD, // @Meta(what = "", where = "ContactList", format = "", info = "Delete the selected contact") KEY_ACTION_DELETE_CONTACT, // @Meta(what = "Action key", where = "ContactList", format = "", info = "Filter the displayed contacts") KEY_ACTION_SEARCH, // @Meta(what = "", where = "", format = "we could use: ' ', ┃, │...", info = "Field separator") DEAULT_FIELD_SEPARATOR, // MainContentList @Meta(what = "Action key", where = "ContactDetails", format = "", info = "Invert the photo's colours") KEY_ACTION_INVERT, // @Meta(what = "Action key", where = "ContactDetails", format = "", info = "Show the photo in 'fullscreen'") KEY_ACTION_FULLSCREEN, // @Meta(what = "Action key", where = "ContactList, ContactDetails, ContactDetailsRaw", format = "", info = "Switch between the available display formats") KEY_ACTION_SWITCH_FORMAT, // multi-usage @Meta(what = "Action key", where = "Contact list, Edit Contact", format = "", info = "Add a new contact/field") KEY_ACTION_ADD, // @Meta(what = "User question: TEXT", where = "Contact list", format = "", info = "New contact") ASK_USER_CONTACT_NAME, // @Meta(what = "User question: [Y|N]", where = "Contact list", format = "%s = contact name", info = "Delete contact") CONFIRM_USER_DELETE_CONTACT, // @Meta(what = "Error", where = "Contact list", format = "%s = contact name", info = "cannot delete a contact") ERR_CANNOT_DELETE_CONTACT, // ; /** * Write the header found in the configuration .properties file of * this {@link Bundle}. * * @param writer * the {@link Writer} to write the header in * @param name * the file name * * @throws IOException * in case of IO error */ static public void writeHeader(Writer writer, String name) throws IOException { writer.write("# " + name + " translation file (UTF-8)\n"); writer.write("# \n"); writer.write("# Note that any key can be doubled with a _NOUTF suffix\n"); writer.write("# to use when the flag --noutf is passed\n"); writer.write("# \n"); writer.write("# Also, the comments always refer to the key below them.\n"); writer.write("# \n"); writer.write("\n"); } };