Author: jcouteau Date: 2011-01-20 13:10:03 +0100 (Thu, 20 Jan 2011) New Revision: 684 Url: http://nuiton.org/repositories/revision/wikitty/684 Log: Use n_() instead of _() in option, better for i18n initialisation Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java 2011-01-19 13:56:39 UTC (rev 683) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java 2011-01-20 12:10:03 UTC (rev 684) @@ -28,7 +28,9 @@ import org.nuiton.wikitty.services.WikittyServiceInMemory; import java.io.File; import java.util.Properties; + import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.n_; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -126,222 +128,222 @@ WIKITTY_CONFIG_FILE( CONFIG_FILE_NAME, - _("Main configuration wikitty file"), + n_("Main configuration wikitty file"), "wikitty-config.properties", String.class, true, true), WIKITTY_DATA_DIR( "wikitty.data.directory", - _("Data directory where wikitty store data"), + n_("Data directory where wikitty store data"), "./target/data", String.class, false, false), WIKITTY_STORAGE_JDBC_QUERY_FILE( "wikitty.storage.jdbc.queryfile", - _("JDBC query configuration file. You can put more than one file" - + " to load specific SQL statement for your database." - + " Exemple: wikitty-jdbc-query.properties,wikitty-jdbc-query-mysql.properties"), + n_("JDBC query configuration file. You can put more than one file" + + " to load specific SQL statement for your database." + + " Exemple: wikitty-jdbc-query.properties,wikitty-jdbc-query-mysql.properties"), "wikitty-jdbc-query.properties", String.class, false, false), WIKITTY_STORAGE_JDBC_DRIVER( "wikitty.storage.jdbc.driver", - _("JDBC driver name"), + n_("JDBC driver name"), "org.h2.Driver", String.class, false, false), WIKITTY_STORAGE_JDBC_URL( "wikitty.storage.jdbc.host", - _("JDBC url"), + n_("JDBC url"), "jdbc:h2:file:${" + WIKITTY_DATA_DIR.getKey() + "}/db", String.class, false, false), WIKITTY_STORAGE_JDBC_LOGIN( "wikitty.storage.jdbc.login", - _("JDBC login name"), + n_("JDBC login name"), "sa", String.class, false, false), WIKITTY_STORAGE_JDBC_PASSWORD( "wikitty.storage.jdbc.password", - _("JDBC password"), + n_("JDBC password"), "", String.class, false, false), WIKITTY_STORAGE_JDBC_XADATASOURCE( "wikitty.storage.jdbc.xadatasource", - _("JDBC xadatasource driver"), + n_("JDBC xadatasource driver"), "org.h2.jdbcx.JdbcDataSource", String.class, false, false), WIKITTY_STORAGE_JDBC_XADATASOURCE_H2_URL( "wikitty.storage.jdbc.xadatasource.org.h2.jdbcx.JdbcDataSource.URL", - _("JDBC xadatasource property h2 url"), + n_("JDBC xadatasource property h2 url"), "${"+WIKITTY_STORAGE_JDBC_URL.getKey() + "}", String.class, false, false), WIKITTY_STORAGE_JDBC_XADATASOURCE_H2_USER( "wikitty.storage.jdbc.xadatasource.org.h2.jdbcx.JdbcDataSource.user", - _("JDBC xadatasource property h2 username"), + n_("JDBC xadatasource property h2 username"), "${"+WIKITTY_STORAGE_JDBC_LOGIN.getKey() + "}", String.class, false, false), WIKITTY_STORAGE_JDBC_XADATASOURCE_H2_PASSWORD( "wikitty.storage.jdbc.xadatasource.org.h2.jdbcx.JdbcDataSource.password", - _("JDBC xadatasource property h2 password"), + n_("JDBC xadatasource property h2 password"), "${"+WIKITTY_STORAGE_JDBC_PASSWORD.getKey() + "}", String.class, false, false), WIKITTY_SEARCHENGINE_SOLR_HOME( "wikitty.searchengine.solr.home", - _("SolR directory home. You can put solr.xml config file in. If" - + " not null, replace solr.solr.home environment vairable"), + n_("SolR directory home. You can put solr.xml config file in. If" + + " not null, replace solr.solr.home environment vairable"), null, String.class, false, false), /* Solr config name are used directly in solr config file. If * you change it, change too in module * wikitty-solr-impl/src/main/resources/solrconfig.xml */ WIKITTY_SEARCHENGINE_SOLR_DIRECTORY_DATA( "wikitty.searchengine.solr.directory.data", - _("Solr data directory"), + n_("Solr data directory"), "${" + WIKITTY_DATA_DIR.getKey() + "}/solr", File.class, false, false), WIKITTY_SEARCHENGINE_SOLR_DIRECTORY_FACTORY( "wikitty.searchengine.solr.directory.factory", - _("SolR storage type possible value: solr.StandardDirectoryFactory" - + " or org.nuiton.wikitty.storage.solr.RAMDirectoryFactory" - + " (or when solr 4.0 will be used org.apache.solr.core.RAMDirectoryFactory)"), + n_("SolR storage type possible value: solr.StandardDirectoryFactory" + + " or org.nuiton.wikitty.storage.solr.RAMDirectoryFactory" + + " (or when solr 4.0 will be used org.apache.solr.core.RAMDirectoryFactory)"), "solr.StandardDirectoryFactory", String.class, false, false), WIKITTY_WIKITTYSERVICE_COMPONENTS( "wikitty.WikittyService.components", - _("WikittyService to use (list must be in right order. " - + "ex: org.nuiton.wikitty.WikittyServiceStorage,org.nuiton.wikitty.WikittyServiceNotifier,org.nuiton.wikitty.WikittyServiceCached,org.nuiton.wikitty.WikittyServiceSecurity)"), + n_("WikittyService to use (list must be in right order. " + + "ex: org.nuiton.wikitty.WikittyServiceStorage,org.nuiton.wikitty.WikittyServiceNotifier,org.nuiton.wikitty.WikittyServiceCached,org.nuiton.wikitty.WikittyServiceSecurity)"), WikittyServiceInMemory.class.getName(), String.class, false, false), WIKITTY_WIKITTYSERVICEINMEMORY_PERSISTENCE( "wikitty.WikittyServiceInMemory.persistence", - _("Indique si les donnees sont stocker entre deux utilisations."), + n_("Indique si les donnees sont stocker entre deux utilisations."), "false", Boolean.class, false, false), WIKITTY_WIKITTYSERVICEINMEMORY_PERSISTENCE_FILE( "wikitty.WikittyServiceInMemory.persistence.file", - _("Fichier ou les donnees sont stocker"), + n_("Fichier ou les donnees sont stocker"), "${" + WIKITTY_DATA_DIR.getKey() + "}/wikitty-inmemory.ser", File.class, false, false), WIKITTY_WIKITTYSERVICESTORAGE_COMPONENTS( "wikitty.WikittyServiceStorage.components", - _("WikittyServiceStorage component to use (ExtensionStorage, WikittyStorage, SearchEngine)"), + n_("WikittyServiceStorage component to use (ExtensionStorage, WikittyStorage, SearchEngine)"), "org.nuiton.wikitty.jdbc.WikittyExtensionStorageJDBC," + "org.nuiton.wikitty.jdbc.WikittyStorageJDBC," + "org.nuiton.wikitty.storage.solr.WikittySearchEngineSolr", String.class, false, false), WIKITTY_WIKITTYSERVICENOTIFIER_COMPONENTS( "wikitty.WikittyServiceNotifier.components", - _("WikittyServiceNotifier component to use (transporter class" - + "to use for propagate or listen remote event)"), + n_("WikittyServiceNotifier component to use (transporter class" + + "to use for propagate or listen remote event)"), XMPPNotifierTransporter.class.getName(), String.class, false, false), WIKITTY_TRANSACTION_WIKITTYSERVICE_COMPONENTS( "wikitty.transaction.WikittyService.components", - _("WikittyService to use for transaction (must be in memory)" - + "ex: org.nuiton.wikitty.services.WikittyServiceInMemory" - + " or org.nuiton.wikitty.services.WikittyServiceInMemoryJdbcSolr)"), + n_("WikittyService to use for transaction (must be in memory)" + + "ex: org.nuiton.wikitty.services.WikittyServiceInMemory" + + " or org.nuiton.wikitty.services.WikittyServiceInMemoryJdbcSolr)"), WikittyServiceInMemory.class.getName(), String.class, false, false), WIKITTY_WIKITTYSERVICECACHED_COMPONENTS( "wikitty.WikittyServiceCached.components", - _("Indique le composant a utiliser pour le cache"), + n_("Indique le composant a utiliser pour le cache"), WikittyCacheJCS.class.getName(), String.class, false, false), WIKITTY_CACHE_PRIORITY_EXTENSIONS( "wikitty.service.cache.priority.extensions", - _("Indique la liste des extensions qui doivent etre conservee prioritairement"), + n_("Indique la liste des extensions qui doivent etre conservee prioritairement"), "", String.class, false, false), WIKITTY_CACHE_SIMPLE_REFERENCE_TYPE( "wikitty.service.cache.simple.reference.type", - _("Indique le type de reference a utiliser pour les extensions" - + " non prioritaires dans le WikittyCacheSimple (soft ou hard)"), + n_("Indique le type de reference a utiliser pour les extensions" + + " non prioritaires dans le WikittyCacheSimple (soft ou hard)"), "soft", String.class, false, false), WIKITTY_WIKITTYSERVICEACCESSSTAT_COMPONENTS( "wikitty.WikittyServiceAccessStat.components", - _("Indique le composant a utiliser pour le stockage des acces"), + n_("Indique le composant a utiliser pour le stockage des acces"), AccessStatStorageWikitty.class.getName(), String.class, false, false), WIKITTY_ACCESSSTAT_EXTENSIONS( "wikitty.service.accessstat.extensions", - _("Indique la liste d'extension dont il faut monitorer l'acces"), + n_("Indique la liste d'extension dont il faut monitorer l'acces"), "WikittyPubText,WikittyPubData", String.class, false, false), WIKITTY_SERVER_CONFIG( "wikitty.service.server.config", - _("Jetty server configuration file name"), + n_("Jetty server configuration file name"), "wikitty-server-config.xml", String.class, false, false), WIKITTY_SERVER_URL( "wikitty.service.server.url", - _("Hessian server url, use by server to know path and port to bind" - + " servlet and client to contact server"), + n_("Hessian server url, use by server to know path and port to bind" + + " servlet and client to contact server"), "http://service.codelutin.com/wikitty", String.class, false, false), WIKITTY_EXPORT_THREADNUMBER( "wikitty.addon.export.threadnumber", - _("number of thread used to export task"), + n_("number of thread used to export task"), "1", Integer.class, false, false), WIKITTY_EXPORT_DIRECTORY( "wikitty.addon.export.directory", - _("directory path where export asynchronous file are stored"), + n_("directory path where export asynchronous file are stored"), "${" + WIKITTY_DATA_DIR.getKey() + "}/export", String.class, false, false), WIKITTY_EXPORT_PUBLICURL( "wikitty.addon.export.publicurl", - _("url used by client to retrieve export file when job is ended"), + n_("url used by client to retrieve export file when job is ended"), "file://${" + WIKITTY_DATA_DIR.getKey() + "}/export/", String.class, false, false), WIKITTY_CACHE_RESTORE_COPIES( "wikitty.service.cache.allwaysRestoreCopies", - _("Indique si le cache retourne des copies des objets ou des proxies"), + n_("Indique si le cache retourne des copies des objets ou des proxies"), "false", Boolean.class, false, false), WIKITTY_EVENT_PROPAGATE( "wikitty.service.event.propagate", - _("Indique si le service d'event propage sur le reseau les evenements"), + n_("Indique si le service d'event propage sur le reseau les evenements"), "false", Boolean.class, false, false), WIKITTY_EVENT_LISTEN( "wikitty.service.event.listen", - _("Indique si le service d'event ecoute sur le reseau les evenements"), + n_("Indique si le service d'event ecoute sur le reseau les evenements"), "false", Boolean.class, false, false), WIKITTY_EVENT_TRANSPORTER_XMPP_SERVER( "wikitty.service.event.transporter.xmpp.server", - _("XMPP server to use for XMPP transporter"), + n_("XMPP server to use for XMPP transporter"), "im.codelutin.com", String.class, false, false), WIKITTY_EVENT_TRANSPORTER_XMPP_ROOM( "wikitty.service.event.transporter.xmpp.room", - _("Room to use for XMPP transporter"), + n_("Room to use for XMPP transporter"), "test@conference.im.codelutin.com", String.class, false, false), WIKITTY_SLAVE_SYNC_STATE_INTERVALE( "wikitty.service.slave.sync.state.intervale", - _("Intervale in second where slave service save state" - + " synchronisation time"), + n_("Intervale in second where slave service save state" + + " synchronisation time"), "300", Integer.class, false, false), WIKITTY_SLAVE_SYNC_STATE_FILE( "wikitty.service.slave.sync.state.file", - _("File path to store synchronisation state"), + n_("File path to store synchronisation state"), "${" + WIKITTY_DATA_DIR.getKey() + "}/syncState", String.class, false, false), WIKITTY_SLAVE_MASTER_URL( "wikitty.service.slave.master.hessian.endpoint", - _("Master url service, where to delegate modification action"), + n_("Master url service, where to delegate modification action"), null, String.class, false, false), WIKITTY_SLAVE_MASTER_XMPP_SERVER( "wikitty.service.slave.master.xmpp.server", - _("XMPP server to use for synchronization with master"), + n_("XMPP server to use for synchronization with master"), "im.codelutin.com", String.class, false, false), WIKITTY_SLAVE_MASTER_XMPP_ROOM( "wikitty.service.slave.master.xmpp.room", - _("Room to use for synchronization with master," - + " this room must have history activated"), + n_("Room to use for synchronization with master," + + " this room must have history activated"), "test@conference.im.codelutin.com", String.class, false, false), WIKITTY_PROXY_TIME_TO_LOG_INFO( "wikitty.proxy.timeToLog.info", - _("maximum time before send log info with time consumed"), + n_("maximum time before send log info with time consumed"), "1000", Integer.class, false, false), WIKITTY_PROXY_TIME_TO_LOG_WARN( "wikitty.proxy.timeToLog.warn", - _("maximum time before send log warn with time consumed"), + n_("maximum time before send log warn with time consumed"), "3000", Integer.class, false, false), JCS_DEFAULT( "jcs.default", - _("jcs auxiliares to use"), + n_("jcs auxiliares to use"), "", String.class, false, false), JCS_DEFAULT_CACHEATTRIBUTES_MAXOBJECTS( "jcs.default.cacheattributes.MaxObjects", - _("jcs maximum number of items allowed in memory"), + n_("jcs maximum number of items allowed in memory"), "1000", String.class, false, false); public String key; @@ -408,7 +410,7 @@ public static enum WikittyAction implements ActionDef { - HELP(_("Wikitty help"), + HELP(n_("Wikitty help"), WikittyConfig.class.getName() + "#help", "-h", "--help"); public String description; @@ -452,12 +454,12 @@ System.out.println("Wikitty configuration and action"); System.out.println("Options (set with --option <key> <value>:"); for (WikittyOption o : WikittyOption.values()) { - log.debug("\t" + o.key + "(" + o.defaultValue + "):" + o.description); + log.debug("\t" + o.key + "(" + o.defaultValue + "):" + _(o.description)); } log.debug("Actions:"); for (WikittyAction a : WikittyAction.values()) { - log.debug("\t" + java.util.Arrays.toString(a.aliases) + "(" + a.action + "):" + a.description); + log.debug("\t" + java.util.Arrays.toString(a.aliases) + "(" + a.action + "):" + _(a.description)); } System.exit(0); }
participants (1)
-
jcouteau@users.nuiton.org