mirror of
https://codeberg.org/PGPainless/cert-d-pgpainless.git
synced 2024-12-22 13:17:58 +01:00
Add support for i18n using resource bundles
This commit is contained in:
parent
a02af58160
commit
20c6bc4c36
18 changed files with 146 additions and 11 deletions
|
@ -26,7 +26,7 @@ import java.sql.SQLException;
|
||||||
|
|
||||||
@CommandLine.Command(
|
@CommandLine.Command(
|
||||||
name = "certificate-store",
|
name = "certificate-store",
|
||||||
description = "Store and manage public OpenPGP certificates",
|
resourceBundle = "msg_pgp-cert-d",
|
||||||
subcommands = {
|
subcommands = {
|
||||||
CommandLine.HelpCommand.class,
|
CommandLine.HelpCommand.class,
|
||||||
Export.class,
|
Export.class,
|
||||||
|
@ -39,7 +39,6 @@ import java.sql.SQLException;
|
||||||
public class PGPCertDCli {
|
public class PGPCertDCli {
|
||||||
|
|
||||||
@CommandLine.Option(names = {"-s", "--store"}, paramLabel = "DIRECTORY",
|
@CommandLine.Option(names = {"-s", "--store"}, paramLabel = "DIRECTORY",
|
||||||
description = "Overwrite the default certificate directory path",
|
|
||||||
scope = CommandLine.ScopeType.INHERIT)
|
scope = CommandLine.ScopeType.INHERIT)
|
||||||
File baseDirectory;
|
File baseDirectory;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import java.io.InputStream;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
@CommandLine.Command(name = "export",
|
@CommandLine.Command(name = "export",
|
||||||
description = "Export all certificates in the store to Standard Output")
|
resourceBundle = "msg_export")
|
||||||
public class Export implements Runnable {
|
public class Export implements Runnable {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Get.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Get.class);
|
||||||
|
|
|
@ -16,15 +16,14 @@ import pgp.certificate_store.exception.BadNameException;
|
||||||
import picocli.CommandLine;
|
import picocli.CommandLine;
|
||||||
|
|
||||||
@CommandLine.Command(name = "get",
|
@CommandLine.Command(name = "get",
|
||||||
description = "Retrieve certificates from the store")
|
resourceBundle = "msg_get")
|
||||||
public class Get implements Runnable {
|
public class Get implements Runnable {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Get.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Get.class);
|
||||||
|
|
||||||
@CommandLine.Parameters(
|
@CommandLine.Parameters(
|
||||||
paramLabel = "IDENTIFIER",
|
paramLabel = "IDENTIFIER",
|
||||||
arity = "1",
|
arity = "1"
|
||||||
description = "Certificate identifier (fingerprint or special name)"
|
|
||||||
)
|
)
|
||||||
String identifer;
|
String identifer;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@CommandLine.Command(name = "import",
|
@CommandLine.Command(name = "import",
|
||||||
description = "Import certificates into the store from Standard Input")
|
resourceBundle = "msg_import")
|
||||||
public class Import implements Runnable {
|
public class Import implements Runnable {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Import.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Import.class);
|
||||||
|
|
|
@ -15,7 +15,7 @@ import picocli.CommandLine;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@CommandLine.Command(name = "insert",
|
@CommandLine.Command(name = "insert",
|
||||||
description = "Insert or update a certificate")
|
resourceBundle = "msg_insert")
|
||||||
public class Insert implements Runnable {
|
public class Insert implements Runnable {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Insert.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Insert.class);
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.security.InvalidAlgorithmParameterException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
@CommandLine.Command(name = "setup",
|
@CommandLine.Command(name = "setup",
|
||||||
description = "Setup a new certificate directory")
|
resourceBundle = "msg_setup")
|
||||||
public class Setup implements Runnable {
|
public class Setup implements Runnable {
|
||||||
|
|
||||||
public static final Logger LOGGER = LoggerFactory.getLogger(Setup.class);
|
public static final Logger LOGGER = LoggerFactory.getLogger(Setup.class);
|
||||||
|
@ -37,8 +37,7 @@ public class Setup implements Runnable {
|
||||||
|
|
||||||
static class Exclusive {
|
static class Exclusive {
|
||||||
@CommandLine.Option(names = "--with-password",
|
@CommandLine.Option(names = "--with-password",
|
||||||
paramLabel = "PASSWORD",
|
paramLabel = "PASSWORD")
|
||||||
description = "Ask for a password for the trust-root key")
|
|
||||||
String password;
|
String password;
|
||||||
|
|
||||||
@CommandLine.Option(names = "--import-from-stdin",
|
@CommandLine.Option(names = "--import-from-stdin",
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Export all certificates in the store to Standard Output
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Usage:\u0020
|
||||||
|
usage.commandListHeading = %nCommands:%n
|
||||||
|
usage.optionListHeading = %nOptions:%n
|
||||||
|
usage.footerHeading=Powered by picocli%n
|
||||||
|
store=Overwrite the default certificate directory path
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Exportiere alle gespeicherten Zertifikate zur Standardausgabe
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Aufruf:\u0020
|
||||||
|
usage.commandListHeading=%nBefehle:%n
|
||||||
|
usage.optionListHeading = %nOptionen:%n
|
||||||
|
usage.footerHeading=Powered by Picocli%n
|
||||||
|
store=Überschreibe den Standardpfad des Zertifikatsverzeichnisses
|
12
pgpainless-cert-d-cli/src/main/resources/msg_get.properties
Normal file
12
pgpainless-cert-d-cli/src/main/resources/msg_get.properties
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Retrieve certificates from the store
|
||||||
|
IDENTIFIER[0]=Certificate identifier (fingerprint or special name)
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Usage:\u0020
|
||||||
|
usage.commandListHeading = %nCommands:%n
|
||||||
|
usage.optionListHeading = %nOptions:%n
|
||||||
|
usage.footerHeading=Powered by picocli%n
|
||||||
|
store=Overwrite the default certificate directory path
|
|
@ -0,0 +1,12 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Frage Zertifikate aus dem Speicher ab
|
||||||
|
IDENTIFIER[0]=Zertifikatskennung (Fingerabdruck oder Spezialname)
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Aufruf:\u0020
|
||||||
|
usage.commandListHeading=%nBefehle:%n
|
||||||
|
usage.optionListHeading = %nOptionen:%n
|
||||||
|
usage.footerHeading=Powered by Picocli%n
|
||||||
|
store=Überschreibe den Standardpfad des Zertifikatsverzeichnisses
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Import certificates into the store from Standard Input
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Usage:\u0020
|
||||||
|
usage.commandListHeading = %nCommands:%n
|
||||||
|
usage.optionListHeading = %nOptions:%n
|
||||||
|
usage.footerHeading=Powered by picocli%n
|
||||||
|
store=Overwrite the default certificate directory path
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Importiere Zertifikate von der Standardeingabe in den Speicher
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Aufruf:\u0020
|
||||||
|
usage.commandListHeading=%nBefehle:%n
|
||||||
|
usage.optionListHeading = %nOptionen:%n
|
||||||
|
usage.footerHeading=Powered by Picocli%n
|
||||||
|
store=Überschreibe den Standardpfad des Zertifikatsverzeichnisses
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Insert or update a certificate
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Usage:\u0020
|
||||||
|
usage.commandListHeading = %nCommands:%n
|
||||||
|
usage.optionListHeading = %nOptions:%n
|
||||||
|
usage.footerHeading=Powered by picocli%n
|
||||||
|
store=Overwrite the default certificate directory path
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Aktualisiere oder importiere ein Zertifikat
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Aufruf:\u0020
|
||||||
|
usage.commandListHeading=%nBefehle:%n
|
||||||
|
usage.optionListHeading = %nOptionen:%n
|
||||||
|
usage.footerHeading=Powered by Picocli%n
|
||||||
|
store=Überschreibe den Standardpfad des Zertifikatsverzeichnisses
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Store and manage public OpenPGP certificates
|
||||||
|
store=Overwrite the default certificate directory path
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Usage:\u0020
|
||||||
|
usage.commandListHeading = %nCommands:%n
|
||||||
|
usage.optionListHeading = %nOptions:%n
|
||||||
|
usage.footerHeading=Powered by picocli%n
|
|
@ -0,0 +1,11 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Speichere und verwalte öffentliche OpenPGP Zertifikate
|
||||||
|
store=Überschreibe den Standardpfad des Zertifikatsverzeichnisses
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Aufruf:\u0020
|
||||||
|
usage.commandListHeading=%nBefehle:%n
|
||||||
|
usage.optionListHeading = %nOptionen:%n
|
||||||
|
usage.footerHeading=Powered by Picocli%n
|
|
@ -0,0 +1,13 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Setup a new certificate directory
|
||||||
|
with-password=Ask for a password for the trust-root key
|
||||||
|
import-from-stdin=Import trust-root from stdin
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Usage:\u0020
|
||||||
|
usage.commandListHeading = %nCommands:%n
|
||||||
|
usage.optionListHeading = %nOptions:%n
|
||||||
|
usage.footerHeading=Powered by picocli%n
|
||||||
|
store=Overwrite the default certificate directory path
|
|
@ -0,0 +1,13 @@
|
||||||
|
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
usage.header=Richte ein neues Zertifikatsverzeichnis ein
|
||||||
|
with-password=Frage nach einem Passwort für den trust-root Schlüssel
|
||||||
|
import-from-stdin=Importiere trust-root Schlüssel von Standardeingabe
|
||||||
|
|
||||||
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
usage.synopsisHeading=Aufruf:\u0020
|
||||||
|
usage.commandListHeading=%nBefehle:%n
|
||||||
|
usage.optionListHeading = %nOptionen:%n
|
||||||
|
usage.footerHeading=Powered by Picocli%n
|
||||||
|
store=Überschreibe den Standardpfad des Zertifikatsverzeichnisses
|
Loading…
Reference in a new issue