1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

wks: Use templates for the server responses.

* common/helpfile.c (gnupg_get_template): Add arg locale_override and
adjust all callers.
* tools/wks-receive.c (struct receive_ctx_s): Add field ct_language.
(get_language): New.
(new_part): Call it.
(wks_receive): Pass language to the result callback.
* tools/gpg-wks-client.c (short_locale): New.
(main): Get and store the current locale.
(command_create): Fix a glitch for the Posteo hack.  Insert the locale
into the confirmation request.
(send_confirmation_response): Ditto.
* tools/gpg-wks-server.c (struct server_ctx_s): Add field language.
(only_ascii): New.
(struct my_subst_vars_s, my_subst_vars_cb, my_subst_vars): New.
(send_confirmation_request): Use a template.
(send_congratulation_message): Ditto.
(check_and_publish): Pss ctx to send_congratulation_message.
(command_receive_cb): Add arg language.

* doc/wks-utils.txt, doc/wks-utils.de.txt: New.
* doc/Makefile.am (helpfiles): Add them.
--

GnuPG-bug-id: 7381

Note that the subject is not yet translated or templated due to a
missing header encoding function.
This commit is contained in:
Werner Koch 2025-06-02 12:42:59 +02:00
parent 982f45c8c7
commit e6463d7fe0
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
12 changed files with 410 additions and 79 deletions

View file

@ -34,7 +34,8 @@ helpfiles = help.txt help.be.txt help.ca.txt help.cs.txt \
help.ja.txt help.nb.txt help.pl.txt help.pt.txt \
help.pt_BR.txt help.ro.txt help.ru.txt help.sk.txt \
help.sv.txt help.tr.txt help.zh_CN.txt help.zh_TW.txt \
mail-tube.txt mail-tube.de.txt
mail-tube.txt mail-tube.de.txt \
wks-utils.txt wks-utils.de.txt
EXTRA_DIST = samplekeys.asc mksamplekeys com-certs.pem \
gnupg-logo.pdf gnupg-logo.png gnupg-logo-tr.png \

73
doc/wks-utils.de.txt Normal file
View file

@ -0,0 +1,73 @@
# wks-utils.txt - gpg-wks-server/-client strings (de) -*- default-generic -*-
# Written in 2025 by g10 Code GmbH
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this text to the
# public domain worldwide. This text is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <https://creativecommons.org/publicdomain/zero/1.0/>.
# SPDX-License-Identifier: CC0-1.0
#
# Note that this template file needs to be UTF-8 encoded. When looking
# for a template item, GnuPG scans the help files in the following order
# (assuming a standard Unix layout):
#
# /etc/gnupg/TEMPLATE.LL_TT.txt
# /etc/gnupg/TEMPLATE.LL.txt
# /etc/gnupg/TEMPLATE.txt
# /usr/share/gnupg/TEMPLATE.LL_TT.txt
# /usr/share/gnupg/TEMPLATE.LL.txt
# /usr/share/gnupg/TEMPLATE.txt
#
# Here TEMPLATE denotes the name of the template (e.g. "mail-tube"),
# LL_TT denotes the full name of the current locale with the territory
# (.e.g. "de_DE"), LL denotes just the locale name (e.g. "de"). The
# first matching item is returned. To put a dot or a hash mark at the
# beginning of a text line, it needs to be prefixed with a dot and a
# space. A single dot may be used to terminated an entry. Depending
# on the template type certain variables (${NAME}) are expanded.
# Check the man page of the respective tool.
.server.confirm.body
Diese Nachricht wurde auf Ihre Anforderung gesendet, Ihren Schlüssel
zu veröffentlichen. Falls Sie solch eine Anforderung nicht gesendet
haben, so ignorieren Sie bitte diese Nachricht.
[English: This message has been send to confirm your request
to publish your key. If you did not request a key
publication, simply ignore this message.]
Viele Mail Software ist in der Lage diese Art von Nachrichten
automatisch zu verarbeiten. In diesem Fall sollten Sie diesen Text
auch nicht sehen. Falls doch so ist Ihre Mailsoftware veraltet und
kann mit dieser Nachricht nichts anfangen. Unter
https://gnupg.org/faq/wkd.html
finden Sie eine Erklärung, wie Sie solche Nachrichten anderweitig
verarbeiten können.
${sigdelim}
Weitere Informationen zu GnuPG finden Sie hier: https://gnupg.org
.
.server.publish.congrats
Hallo!
Der Schlüssel für Ihre Mailadresse '${address}' wurde soeben vom
Web Key Directory akzeptiert. Je nach Konfiguration Ihres Providers kann
es bis zu 15 Minuten dauern, bis er öffentlich sichtbar wird.
Viele Grüße von Ihrem
Schlüsselveröffentlichungsdienst
${sigdelim}
Weitere Informationen zu GnuPG finden Sie hier: https://gnupg.org
.

71
doc/wks-utils.txt Normal file
View file

@ -0,0 +1,71 @@
# wks-utils.txt - gpg-wks-server/-client strings (en) -*- default-generic -*-
# Written in 2025 by g10 Code GmbH
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this text to the
# public domain worldwide. This text is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <https://creativecommons.org/publicdomain/zero/1.0/>.
# SPDX-License-Identifier: CC0-1.0
#
# Note that this template file needs to be UTF-8 encoded. When looking
# for a template item, GnuPG scans the help files in the following order
# (assuming a standard Unix layout):
#
# /etc/gnupg/TEMPLATE.LL_TT.txt
# /etc/gnupg/TEMPLATE.LL.txt
# /etc/gnupg/TEMPLATE.txt
# /usr/share/gnupg/TEMPLATE.LL_TT.txt
# /usr/share/gnupg/TEMPLATE.LL.txt
# /usr/share/gnupg/TEMPLATE.txt
#
# Here TEMPLATE denotes the name of the template (e.g. "mail-tube"),
# LL_TT denotes the full name of the current locale with the territory
# (.e.g. "de_DE"), LL denotes just the locale name (e.g. "de"). The
# first matching item is returned. To put a dot or a hash mark at the
# beginning of a text line, it needs to be prefixed with a dot and a
# space. A single dot may be used to terminated an entry. Depending
# on the template type certain variables (${NAME}) are expanded.
# Check the man page of the respective tool.
.server.confirm.body
This message has been send to confirm your request
to publish your key. If you did not request a key
publication, simply ignore this message.
Most mail software can handle this kind of message
automatically and thus you would not have seen this
message. It seems that your client does not fully
support this service. The web page
https://gnupg.org/faq/wkd.html
explains how you can process this message anyway in
a few manual steps.
${sigdelim}
For information on GnuPG see: https://gnupg.org
.
.server.publish.congrats
Hello!
The key for your address '${address}' has been published
and can now be retrieved from the Web Key Directory.
For more information on this system see:
https://gnupg.org/faq/wkd.html
Best regards
GnuPG Key Publisher
${sigdelim}
For information on GnuPG see: https://gnupg.org
.

View file

@ -358,6 +358,15 @@ use option @option{-q}.
The command @option{--revoke-key} is not yet functional.
This tool needs to insert strings into the mails which can be
configured using a plain text file. The installed default files for
English (@file{wks-utils.txt}) and German (@file{wks-utils.de.txt})
can be copied to the system configuration directory and changed to
local needs. Environment variables in these texts are expanded, the
variable ``sigdelim'' is replaced by two dashes and a blank, the
variable ``address'' is replaced by the mail address of the key to be
published.
@mansect options
@noindent