2 * Copyright (C) 2016 Hiroshi Miura
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package org.dict.zip.cli;
21 import java.text.MessageFormat;
22 import java.util.Locale;
23 import java.util.ResourceBundle;
26 * Application specific constants.
27 * @author Hiroshi Miura
29 public class AppConsts {
30 static final String VERSION = ResourceBundle.getBundle("org/dict/zip/Version")
31 .getString("version");
32 static final String UPDATE = ResourceBundle.getBundle("org/dict/zip/Version")
34 static final String REVISION = ResourceBundle.getBundle("org/dict/zip/Version")
35 .getString("revision");
37 static final ResourceBundle _messages = ResourceBundle.getBundle("org/dict/zip/cli/Bundle",
40 static final String NAME = _messages.getString("application.name");
41 static final String BRANDING = "";
42 static final String YEAR = "2016";
43 static final String AUTHORS = "Hiroshi Miura";
44 static final String LICENSE = "GPLv2+";
46 private static String getString(final String key) {
47 return _messages.getString(key);
50 static String getNameAndVersion() {
51 if (UPDATE != null && !UPDATE.equals("0")) {
52 return MessageFormat.format(getString("app-version-template-pretty-update"),
53 getApplicationName(), VERSION, UPDATE);
55 return MessageFormat.format(getString("app-version-template-pretty"),
56 getApplicationName(), VERSION);
60 static String getApplicationName() {
61 return BRANDING.isEmpty() ? NAME : NAME + " " + BRANDING;