Add support for i18n using resource bundles

This commit is contained in:
Paul Schaub 2022-08-04 13:26:22 +02:00
parent 55b08bcb25
commit 607518f945
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
6 changed files with 48 additions and 8 deletions

View file

@ -11,7 +11,7 @@ import picocli.CommandLine;
@CommandLine.Command(
name = "wkd",
description = "Interact with the Web Key Directory",
resourceBundle = "msg_wkd",
subcommands = {
CommandLine.HelpCommand.class,
GetCmd.class

View file

@ -21,22 +21,18 @@ import java.io.OutputStream;
@CommandLine.Command(
name = "get",
description = "Get an OpenPGP Certificate via the Web Key Directory"
resourceBundle = "msg_get"
)
public class GetCmd implements Runnable {
@CommandLine.Parameters(
index = "0",
arity = "1",
paramLabel = "USERID",
description = "Certificate User-ID"
)
paramLabel = "USERID")
String userId;
@CommandLine.Option(
names = {"-a", "--armor"},
description = "ASCII Armor the output"
)
names = {"-a", "--armor"})
boolean armor = false;
public static final CertificateDiscoverer DEFAULT_DISCOVERER = new ValidatingCertificateDiscoverer(

View file

@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
#
# SPDX-License-Identifier: Apache-2.0
usage.header=Get an OpenPGP Certificate via the Web Key Directory
USERID[0]=Certificate User-ID
armor=ASCII Armor the 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

View file

@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
#
# SPDX-License-Identifier: Apache-2.0
usage.header=Empfange ein OpenPGP Zertifikat mithilfe des Web Key Directory
USERID[0]=Nutzeridentität des Zertifikats
armor=Schütze die Ausgabe mit ASCII Armor
# 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

View file

@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
#
# SPDX-License-Identifier: Apache-2.0
usage.header=Interact with the Web Key Directory
# 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

View file

@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
#
# SPDX-License-Identifier: Apache-2.0
usage.header=Interagiere mit dem Web Key Directory
# 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