mirror of
https://codeberg.org/PGPainless/wkd-java.git
synced 2024-11-21 14:52:12 +01:00
Add support for i18n using resource bundles
This commit is contained in:
parent
55b08bcb25
commit
607518f945
6 changed files with 48 additions and 8 deletions
|
@ -11,7 +11,7 @@ import picocli.CommandLine;
|
||||||
|
|
||||||
@CommandLine.Command(
|
@CommandLine.Command(
|
||||||
name = "wkd",
|
name = "wkd",
|
||||||
description = "Interact with the Web Key Directory",
|
resourceBundle = "msg_wkd",
|
||||||
subcommands = {
|
subcommands = {
|
||||||
CommandLine.HelpCommand.class,
|
CommandLine.HelpCommand.class,
|
||||||
GetCmd.class
|
GetCmd.class
|
||||||
|
|
|
@ -21,22 +21,18 @@ import java.io.OutputStream;
|
||||||
|
|
||||||
@CommandLine.Command(
|
@CommandLine.Command(
|
||||||
name = "get",
|
name = "get",
|
||||||
description = "Get an OpenPGP Certificate via the Web Key Directory"
|
resourceBundle = "msg_get"
|
||||||
)
|
)
|
||||||
public class GetCmd implements Runnable {
|
public class GetCmd implements Runnable {
|
||||||
|
|
||||||
@CommandLine.Parameters(
|
@CommandLine.Parameters(
|
||||||
index = "0",
|
index = "0",
|
||||||
arity = "1",
|
arity = "1",
|
||||||
paramLabel = "USERID",
|
paramLabel = "USERID")
|
||||||
description = "Certificate User-ID"
|
|
||||||
)
|
|
||||||
String userId;
|
String userId;
|
||||||
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = {"-a", "--armor"},
|
names = {"-a", "--armor"})
|
||||||
description = "ASCII Armor the output"
|
|
||||||
)
|
|
||||||
boolean armor = false;
|
boolean armor = false;
|
||||||
|
|
||||||
public static final CertificateDiscoverer DEFAULT_DISCOVERER = new ValidatingCertificateDiscoverer(
|
public static final CertificateDiscoverer DEFAULT_DISCOVERER = new ValidatingCertificateDiscoverer(
|
||||||
|
|
12
wkd-java-cli/src/main/resources/msg_get.properties
Normal file
12
wkd-java-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=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
|
12
wkd-java-cli/src/main/resources/msg_get_de.properties
Normal file
12
wkd-java-cli/src/main/resources/msg_get_de.properties
Normal 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
|
10
wkd-java-cli/src/main/resources/msg_wkd.properties
Normal file
10
wkd-java-cli/src/main/resources/msg_wkd.properties
Normal 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
|
10
wkd-java-cli/src/main/resources/msg_wkd_de.properties
Normal file
10
wkd-java-cli/src/main/resources/msg_wkd_de.properties
Normal 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
|
Loading…
Reference in a new issue