357468984efebf66365a5dfac75010d7120e42ce
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1) # SPDX-FileCopyrightText: 2024 Marco Ricci <software@the13thletter.info>
2) #
3) # SPDX-Licence-Identifier: MIT
4) 
5) """Internal module.  Do not use.  Contains error strings and functions."""
6) 
7) from __future__ import annotations
8) 
Marco Ricci Add a writer function for d...

Marco Ricci authored 1 week ago

9) import datetime
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

10) import enum
11) import gettext
12) import inspect
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

13) import textwrap
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

14) import types
Marco Ricci Add a writer function for d...

Marco Ricci authored 1 week ago

15) from typing import TYPE_CHECKING, NamedTuple, TextIO, cast
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

16) 
17) import derivepassphrase as dpp
18) 
19) if TYPE_CHECKING:
20)     from collections.abc import Iterable, Mapping
21) 
22)     from typing_extensions import Any, Self
23) 
24) __author__ = dpp.__author__
25) __version__ = dpp.__version__
26) 
27) __all__ = ('PROG_NAME',)
28) 
29) PROG_NAME = 'derivepassphrase'
30) translation = gettext.translation(PROG_NAME, fallback=True)
31) 
32) 
33) class TranslatableString(NamedTuple):
34)     singular: str
35)     plural: str
36)     l10n_context: str
37)     translator_comments: str
38)     flags: frozenset[str]
39) 
40) 
41) def _prepare_translatable(
42)     msg: str,
43)     comments: str = '',
44)     context: str = '',
45)     plural_msg: str = '',
46)     *,
47)     flags: Iterable[str] = (),
48) ) -> TranslatableString:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

49)     def maybe_rewrap(string: str) -> str:
50)         string = inspect.cleandoc(string)
51)         if not any(s.strip() == '\b' for s in string.splitlines()):
52)             string = '\n'.join(
53)                 textwrap.wrap(
54)                     string,
55)                     width=float('inf'),  # type: ignore[arg-type]
56)                     fix_sentence_endings=True,
57)                 )
58)             )
59)         else:  # pragma: no cover
60)             string = ''.join(
61)                 s
62)                 for s in string.splitlines(True)  # noqa: FBT003
63)                 if s.strip() == '\b'
64)             )
65)         return string
66) 
67)     msg = maybe_rewrap(msg)
68)     plural_msg = maybe_rewrap(plural_msg)
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

69)     context = context.strip()
70)     comments = inspect.cleandoc(comments)
71)     flags = (
72)         frozenset(f.strip() for f in flags)
73)         if not isinstance(flags, str)
74)         else frozenset({flags})
75)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

76)     assert '{' not in msg or bool(
77)         flags & {'python-brace-format', 'no-python-brace-format'}
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

78)     ), f'Missing flag for how to deal with brace in {msg!r}'
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

79)     assert '%' not in msg or bool(
80)         flags & {'python-format', 'no-python-format'}
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

81)     ), f'Missing flag for how to deal with percent character in {msg!r}'
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

82)     assert (
83)         not flags & {'python-format', 'python-brace-format'}
84)         or '%' in msg
85)         or '{' in msg
86)     ), f'Missing format string parameters in {msg!r}'
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

87)     return TranslatableString(msg, plural_msg, context, comments, flags)
88) 
89) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

90) class TranslatedString:
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

91)     def __init__(
92)         self,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

93)         template: (
94)             str
95)             | TranslatableString
96)             | Label
97)             | InfoMsgTemplate
98)             | WarnMsgTemplate
99)             | ErrMsgTemplate
100)         ),
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

101)         args_dict: Mapping[str, Any] = types.MappingProxyType({}),
102)         /,
103)         **kwargs: Any,  # noqa: ANN401
104)     ) -> None:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

105)         if isinstance(
106)             template, (Label, InfoMsgTemplate, WarnMsgTemplate, ErrMsgTemplate)
107)         ):
108)             template = cast(TranslatableString, template.value)
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

109)         self.template = template
110)         self.kwargs = {**args_dict, **kwargs}
111)         self._rendered: str | None = None
112) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

113)     def __bool__(self) -> bool:
114)         return bool(str(self))
115) 
116)     def __eq__(self, other: object) -> bool:  # pragma: no cover
117)         return str(self) == other
118) 
119)     def __hash__(self) -> int:  # pragma: no cover
120)         return hash(str(self))
121) 
122)     def __repr__(self) -> str:  # pragma: no cover
123)         return (
124)             f'{self.__class__.__name__}({self.template!r}, '
125)             f'{dict(self.kwargs)!r})'
126)         )
127) 
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

128)     def __str__(self) -> str:
129)         if self._rendered is None:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

130)             # raw str support is currently unneeded, so excluded from coverage
131)             if isinstance(self.template, str):  # pragma: no cover
132)                 context = None
133)                 template = self.template
134)             else:
135)                 context = self.template.l10n_context
136)                 template = self.template.singular
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

137)             if context is not None:
138)                 template = translation.pgettext(context, template)
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

139)             else:  # pragma: no cover
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

140)                 template = translation.gettext(template)
141)             self._rendered = template.format(**self.kwargs)
142)         return self._rendered
143) 
144)     def maybe_without_filename(self) -> Self:
145)         if (
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

146)             not isinstance(self.template, str)
147)             and self.kwargs.get('filename') is None
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

148)             and ': {filename!r}' in self.template.singular
149)         ):
150)             singular = ''.join(
151)                 self.template.singular.split(': {filename!r}', 1)
152)             )
153)             plural = (
154)                 ''.join(self.template.plural.split(': {filename!r}', 1))
155)                 if self.template.plural
156)                 else self.template.plural
157)             )
158)             return self.__class__(
159)                 self.template._replace(singular=singular, plural=plural),
160)                 self.kwargs,
161)             )
162)         return self
163) 
164) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

165) class Label(enum.Enum):
166)     DEPRECATION_WARNING_LABEL = _prepare_translatable(
167)         'Deprecation warning', comments='', context='diagnostic label'
168)     )
169)     WARNING_LABEL = _prepare_translatable(
170)         'Warning', comments='', context='diagnostic label'
171)     )
172)     DERIVEPASSPHRASE_01 = _prepare_translatable(
173)         msg="""
174)         Derive a strong passphrase, deterministically, from a master secret.
175)         """,
176)         comments='',
177)         context='help text (long form)',
178)     )
179)     DERIVEPASSPHRASE_02 = _prepare_translatable(
180)         msg="""
181)         The currently implemented subcommands are "vault" (for the
182)         scheme used by vault) and "export" (for exporting foreign
183)         configuration data).  See the respective `--help` output for
184)         instructions.  If no subcommand is given, we default to "vault".
185)         """,
186)         comments='',
187)         context='help text (long form)',
188)     )
189)     DERIVEPASSPHRASE_03 = _prepare_translatable(
190)         msg="""
191)         Deprecation notice: Defaulting to "vault" is deprecated.
192)         Starting in v1.0, the subcommand must be specified explicitly.
193)         """,
194)         comments='',
195)         context='help text (long form)',
196)     )
197)     DERIVEPASSPHRASE_EPILOG_01 = _prepare_translatable(
198)         msg=r"""
199)         Configuration is stored in a directory according to the
200)         `DERIVEPASSPHRASE_PATH` variable, which defaults to
201)         `~/.derivepassphrase` on UNIX-like systems and
202)         `C:\Users\<user>\AppData\Roaming\Derivepassphrase` on Windows.
203)         """,
204)         comments='',
205)         context='help text (long form)',
206)     )
207)     DERIVEPASSPHRASE_EXPORT_01 = _prepare_translatable(
208)         msg="""
209)         Export a foreign configuration to standard output.
210)         """,
211)         comments='',
212)         context='help text (long form)',
213)     )
214)     DERIVEPASSPHRASE_EXPORT_02 = _prepare_translatable(
215)         msg="""
216)         The only available subcommand is "vault", which implements the
217)         vault-native configuration scheme.  If no subcommand is given,
218)         we default to "vault".
219)         """,
220)         comments='',
221)         context='help text (long form)',
222)     )
223)     DERIVEPASSPHRASE_EXPORT_03 = DERIVEPASSPHRASE_03
224)     DERIVEPASSPHRASE_EXPORT_VAULT_01 = _prepare_translatable(
225)         msg="""
226)         Export a vault-native configuration to standard output.
227)         """,
228)         comments='',
229)         context='help text (long form)',
230)     )
231)     DERIVEPASSPHRASE_EXPORT_VAULT_02 = _prepare_translatable(
232)         msg="""
233)         Depending on the configuration format, {path_metavar!s} may
234)         either be a file or a directory.  We support the vault "v0.2",
235)         "v0.3" and "storeroom" formats.
236)         """,
237)         comments='',
238)         context='help text (long form)',
239)         flags='python-brace-format',
240)     )
241)     DERIVEPASSPHRASE_EXPORT_VAULT_03 = _prepare_translatable(
242)         msg="""
243)         If {path_metavar!s} is explicitly given as `VAULT_PATH`, then
244)         use the `VAULT_PATH` environment variable to determine the
245)         correct path.  (Use `./VAULT_PATH` or similar to indicate
246)         a file/directory actually named `VAULT_PATH`.)
247)         """,
248)         comments='',
249)         context='help text (long form)',
250)         flags='python-brace-format',
251)     )
252)     DERIVEPASSPHRASE_VAULT_01 = _prepare_translatable(
253)         msg="""
254)         Derive a passphrase using the vault derivation scheme.
255)         """,
256)         comments='',
257)         context='help text (long form)',
258)     )
259)     DERIVEPASSPHRASE_VAULT_02 = _prepare_translatable(
260)         msg="""
261)         If operating on global settings, or importing/exporting
262)         settings, then {service_metavar!s} must be omitted.  Otherwise
263)         it is required.
264)         """,
265)         comments='',
266)         context='help text (long form)',
267)         flags='python-brace-format',
268)     )
269)     DERIVEPASSPHRASE_VAULT_EPILOG_01 = _prepare_translatable(
270)         msg="""
271)         WARNING: There is NO WAY to retrieve the generated passphrases
272)         if the master passphrase, the SSH key, or the exact passphrase
273)         settings are lost, short of trying out all possible
274)         combinations.  You are STRONGLY advised to keep independent
275)         backups of the settings and the SSH key, if any.
276)         """,
277)         comments='',
278)         context='help text (long form)',
279)     )
280)     DERIVEPASSPHRASE_VAULT_EPILOG_02 = _prepare_translatable(
281)         msg="""
282)         The configuration is NOT encrypted, and you are STRONGLY
283)         discouraged from using a stored passphrase.
284)         """,
285)         comments='',
286)         context='help text (long form)',
287)     )
288)     DEPRECATED_COMMAND_LABEL = _prepare_translatable(
289)         msg='(Deprecated) {text}',
290)         comments='',
291)         context='help text (long form, label)',
292)         flags='python-brace-format',
293)     )
294)     DEBUG_OPTION_HELP_TEXT = _prepare_translatable(
295)         'also emit debug information (implies --verbose)',
296)         comments='',
297)         context='help text (option one-line description)',
298)     )
299)     EXPORT_VAULT_FORMAT_HELP_TEXT = _prepare_translatable(
300)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

301)         TRANSLATORS: The defaults_hint is
302)         Label.EXPORT_VAULT_FORMAT_DEFAULTS_HELP_TEXT, the metavar is
303)         Label.EXPORT_VAULT_FORMAT_METAVAR_FMT.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

304)         """,
305)         msg=r"""
306)         try the following storage format {metavar!s}; may be
307)         specified multiple times, formats will be tried in order
308)         {defaults_hint!s}
309)         """,
310)         context='help text (option one-line description)',
311)         flags='python-brace-format',
312)     )
313)     EXPORT_VAULT_FORMAT_DEFAULTS_HELP_TEXT = _prepare_translatable(
314)         comments=r"""
315)         TRANSLATORS: See EXPORT_VAULT_FORMAT_HELP_TEXT.  The format
316)         names/labels "v0.3", "v0.2" and "storeroom" should not be
317)         translated.
318)         """,
319)         msg=r"""
320)         (default: v0.3, v0.2, storeroom)
321)         """,
322)         context='help text (option one-line description)',
323)     )
324)     EXPORT_VAULT_KEY_HELP_TEXT = _prepare_translatable(
325)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

326)         TRANSLATORS: The defaults_hint is
327)         Label.EXPORT_VAULT_KEY_DEFAULTS_HELP_TEXT, the metavar is
328)         Label.EXPORT_VAULT_KEY_METAVAR_K.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

329)         """,
330)         msg=r"""
331)         use {metavar!s} as the storage master key {defaults_hint!s}
332)         """,
333)         context='help text (option one-line description)',
334)         flags='python-brace-format',
335)     )
336)     EXPORT_VAULT_KEY_DEFAULTS_HELP_TEXT = _prepare_translatable(
337)         comments=r"""
338)         TRANSLATORS: See EXPORT_VAULT_KEY_HELP_TEXT.
339)         """,
340)         msg=r"""
341)         (default: check the `VAULT_KEY`, `LOGNAME`, `USER`, or
342)         `USERNAME` environment variables)
343)         """,
344)         context='help text (option one-line description)',
345)     )
346)     QUIET_OPTION_HELP_TEXT = _prepare_translatable(
347)         'suppress even warnings, emit only errors',
348)         comments='',
349)         context='help text (option one-line description)',
350)     )
351)     VERBOSE_OPTION_HELP_TEXT = _prepare_translatable(
352)         'emit extra/progress information to standard error',
353)         comments='',
354)         context='help text (option one-line description)',
355)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

356) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

357)     DERIVEPASSPHRASE_VAULT_PHRASE_HELP_TEXT = _prepare_translatable(
358)         msg='prompt for a master passphrase',
359)         comments='',
360)         context='help text (option one-line description)',
361)     )
362)     DERIVEPASSPHRASE_VAULT_KEY_HELP_TEXT = _prepare_translatable(
363)         msg='select a suitable SSH key from the SSH agent',
364)         comments='',
365)         context='help text (option one-line description)',
366)     )
367)     DERIVEPASSPHRASE_VAULT_LENGTH_HELP_TEXT = _prepare_translatable(
368)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

369)         TRANSLATORS: The metavar is
370)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

371)         """,
372)         msg='ensure a passphrase length of {metavar!s} characters',
373)         context='help text (option one-line description)',
374)         flags='python-brace-format',
375)     )
376)     DERIVEPASSPHRASE_VAULT_REPEAT_HELP_TEXT = _prepare_translatable(
377)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

378)         TRANSLATORS: The metavar is
379)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

380)         """,
381)         msg='forbid any run of {metavar!s} identical characters',
382)         context='help text (option one-line description)',
383)         flags='python-brace-format',
384)     )
385)     DERIVEPASSPHRASE_VAULT_LOWER_HELP_TEXT = _prepare_translatable(
386)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

387)         TRANSLATORS: The metavar is
388)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

389)         """,
390)         msg='ensure at least {metavar!s} lowercase characters',
391)         context='help text (option one-line description)',
392)         flags='python-brace-format',
393)     )
394)     DERIVEPASSPHRASE_VAULT_UPPER_HELP_TEXT = _prepare_translatable(
395)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

396)         TRANSLATORS: The metavar is
397)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

398)         """,
399)         msg='ensure at least {metavar!s} uppercase characters',
400)         context='help text (option one-line description)',
401)         flags='python-brace-format',
402)     )
403)     DERIVEPASSPHRASE_VAULT_NUMBER_HELP_TEXT = _prepare_translatable(
404)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

405)         TRANSLATORS: The metavar is
406)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

407)         """,
408)         msg='ensure at least {metavar!s} digits',
409)         context='help text (option one-line description)',
410)         flags='python-brace-format',
411)     )
412)     DERIVEPASSPHRASE_VAULT_SPACE_HELP_TEXT = _prepare_translatable(
413)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

414)         TRANSLATORS: The metavar is
415)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

416)         """,
417)         msg='ensure at least {metavar!s} spaces',
418)         context='help text (option one-line description)',
419)         flags='python-brace-format',
420)     )
421)     DERIVEPASSPHRASE_VAULT_DASH_HELP_TEXT = _prepare_translatable(
422)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

423)         TRANSLATORS: The metavar is
424)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

425)         """,
426)         msg='ensure at least {metavar!s} "-" or "_" characters',
427)         context='help text (option one-line description)',
428)         flags='python-brace-format',
429)     )
430)     DERIVEPASSPHRASE_VAULT_SYMBOL_HELP_TEXT = _prepare_translatable(
431)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

432)         TRANSLATORS: The metavar is
433)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

434)         """,
435)         msg='ensure at least {metavar!s} symbol characters',
436)         context='help text (option one-line description)',
437)         flags='python-brace-format',
438)     )
439) 
440)     DERIVEPASSPHRASE_VAULT_NOTES_HELP_TEXT = _prepare_translatable(
441)         msg='spawn an editor to edit notes for {service_metavar!s}',
442)         comments='',
443)         context='help text (option one-line description)',
444)         flags='python-brace-format',
445)     )
446)     DERIVEPASSPHRASE_VAULT_CONFIG_HELP_TEXT = _prepare_translatable(
447)         msg='save the given settings for {service_metavar!s}, or global',
448)         comments='',
449)         context='help text (option one-line description)',
450)         flags='python-brace-format',
451)     )
452)     DERIVEPASSPHRASE_VAULT_DELETE_HELP_TEXT = _prepare_translatable(
453)         msg='delete the settings for {service_metavar!s}',
454)         comments='',
455)         context='help text (option one-line description)',
456)         flags='python-brace-format',
457)     )
458)     DERIVEPASSPHRASE_VAULT_DELETE_GLOBALS_HELP_TEXT = _prepare_translatable(
459)         msg='delete the global settings',
460)         comments='',
461)         context='help text (option one-line description)',
462)     )
463)     DERIVEPASSPHRASE_VAULT_DELETE_ALL_HELP_TEXT = _prepare_translatable(
464)         msg='delete all settings',
465)         comments='',
466)         context='help text (option one-line description)',
467)     )
468)     DERIVEPASSPHRASE_VAULT_EXPORT_HELP_TEXT = _prepare_translatable(
469)         comments="""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

470)         TRANSLATORS: The metavar is
471)         Label.STORAGE_MANAGEMENT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

472)         """,
473)         msg='export all saved settings to {metavar!s}',
474)         context='help text (option one-line description)',
475)         flags='python-brace-format',
476)     )
477)     DERIVEPASSPHRASE_VAULT_IMPORT_HELP_TEXT = _prepare_translatable(
478)         comments="""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

479)         TRANSLATORS: The metavar is
480)         Label.STORAGE_MANAGEMENT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

481)         """,
482)         msg='import saved settings from {metavar!s}',
483)         context='help text (option one-line description)',
484)         flags='python-brace-format',
485)     )
486)     DERIVEPASSPHRASE_VAULT_OVERWRITE_HELP_TEXT = _prepare_translatable(
487)         comments="""
488)         TRANSLATORS: The corresponding option is displayed as
489)         "--overwrite-existing / --merge-existing", so you may want to
490)         hint that the default (merge) is the second of those options.
491)         """,
492)         msg='overwrite or merge (default) the existing configuration',
493)         context='help text (option one-line description)',
494)     )
495)     DERIVEPASSPHRASE_VAULT_UNSET_HELP_TEXT = _prepare_translatable(
496)         comments="""
497)         TRANSLATORS: The corresponding option is displayed as
498)         "--unset=phrase|key|...|symbol", so the "given setting" is
499)         referring to "phrase", "key", "lower", ..., or "symbol",
500)         respectively.  "with --config" here means that the user must
501)         also specify "--config" for this option to have any effect.
502)         """,
503)         msg="""
504)         with --config, also unsets the given setting; may be specified
505)         multiple times
506)         """,
507)         context='help text (option one-line description)',
508)     )
509)     DERIVEPASSPHRASE_VAULT_EXPORT_AS_HELP_TEXT = _prepare_translatable(
510)         comments="""
511)         TRANSLATORS: The corresponding option is displayed as
512)         "--export-as=json|sh", so json refers to the JSON format
513)         (default) and sh refers to the POSIX sh format.
514)         """,
515)         msg='when exporting, export as JSON (default) or POSIX sh',
516)         context='help text (option one-line description)',
517)     )
518) 
519)     EXPORT_VAULT_FORMAT_METAVAR_FMT = _prepare_translatable(
520)         msg='FMT',
521)         comments='',
522)         context='help text, metavar (export vault subcommand)',
523)     )
524)     EXPORT_VAULT_KEY_METAVAR_K = _prepare_translatable(
525)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

526)         TRANSLATORS: See Label.EXPORT_VAULT_KEY_HELP_TEXT.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

527)         """,
528)         msg='K',
529)         context='help text, metavar (export vault subcommand)',
530)     )
531)     EXPORT_VAULT_METAVAR_PATH = _prepare_translatable(
532)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

533)         TRANSLATORS: Used as "path_metavar" in
534)         Label.DERIVEPASSPHRASE_EXPORT_VAULT_02 and others.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

535)         """,
536)         msg='PATH',
537)         context='help text, metavar (export vault subcommand)',
538)     )
539)     PASSPHRASE_GENERATION_METAVAR_NUMBER = _prepare_translatable(
540)         comments=r"""
541)         TRANSLATORS: This metavar is also used in a matching epilog.
542)         """,
543)         msg='NUMBER',
544)         context='help text, metavar (passphrase generation group)',
545)     )
546)     STORAGE_MANAGEMENT_METAVAR_PATH = _prepare_translatable(
547)         comments=r"""
548)         TRANSLATORS: This metavar is also used in multiple one-line help
549)         texts.
550)         """,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

551)         msg='PATH',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

552)         context='help text, metavar (storage management group)',
553)     )
554)     VAULT_METAVAR_SERVICE = _prepare_translatable(
555)         comments=r"""
556)         TRANSLATORS: This metavar is also used in multiple one-line help
557)         texts, as "service_metavar".
558)         """,
559)         msg='SERVICE',
560)         context='help text, metavar (vault subcommand)',
561)     )
562)     CONFIGURATION_EPILOG = _prepare_translatable(
563)         'Use $VISUAL or $EDITOR to configure the spawned editor.',
564)         comments='',
565)         context='help text, option group epilog (configuration group)',
566)     )
567)     PASSPHRASE_GENERATION_EPILOG = _prepare_translatable(
568)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

569)         TRANSLATORS: The metavar is
570)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

571)         """,
572)         msg=r"""
573)         Use {metavar!s}=0 to exclude a character type from the output.
574)         """,
575)         context='help text, option group epilog (passphrase generation group)',
576)         flags='python-brace-format',
577)     )
578)     STORAGE_MANAGEMENT_EPILOG = _prepare_translatable(
579)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

580)         TRANSLATORS: The metavar is
581)         Label.STORAGE_MANAGEMENT_METAVAR_PATH.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

582)         """,
583)         msg=r"""
584)         Using "-" as {metavar!s} for standard input/standard output
585)         is supported.
586)         """,
587)         context='help text, option group epilog (storage management group)',
588)         flags='python-brace-format',
589)     )
590)     COMMANDS_LABEL = _prepare_translatable(
591)         'Commands', comments='', context='help text, option group name'
592)     )
593)     COMPATIBILITY_OPTION_LABEL = _prepare_translatable(
594)         'Compatibility and extension options',
595)         comments='',
596)         context='help text, option group name',
597)     )
598)     CONFIGURATION_LABEL = _prepare_translatable(
599)         'Configuration', comments='', context='help text, option group name'
600)     )
601)     LOGGING_LABEL = _prepare_translatable(
602)         'Logging', comments='', context='help text, option group name'
603)     )
604)     OPTIONS_LABEL = _prepare_translatable(
605)         'Options', comments='', context='help text, option group name'
606)     )
607)     OTHER_OPTIONS_LABEL = _prepare_translatable(
608)         'Other options', comments='', context='help text, option group name'
609)     )
610)     PASSPHRASE_GENERATION_LABEL = _prepare_translatable(
611)         'Passphrase generation',
612)         comments='',
613)         context='help text, option group name',
614)     )
615)     STORAGE_MANAGEMENT_LABEL = _prepare_translatable(
616)         'Storage management',
617)         comments='',
618)         context='help text, option group name',
619)     )
620)     CONFIRM_THIS_CHOICE_PROMPT_TEXT = _prepare_translatable(
621)         comments=r"""
622)         TRANSLATORS: There is no support for "yes" or "no" in other
623)         languages than English, so it is advised that your translation
624)         makes it clear that only the strings "y", "yes", "n" or "no" are
625)         supported, even if the prompt becomes a bit longer.
626)         """,
627)         msg='Confirm this choice? (y/N)',
628)         context='interactive prompt',
629)     )
630)     SUITABLE_SSH_KEYS_LABEL = _prepare_translatable(
631)         comments=r"""
632)         TRANSLATORS: This label is the heading of the list of suitable
633)         SSH keys.
634)         """,
635)         msg='Suitable SSH keys:',
636)         context='interactive prompt',
637)     )
638)     YOUR_SELECTION_PROMPT_TEXT = _prepare_translatable(
639)         'Your selection? (1-{n}, leave empty to abort)',
640)         comments='',
641)         context='interactive prompt',
642)         flags='python-brace-format',
643)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

644) 
645) 
646) class InfoMsgTemplate(enum.Enum):
647)     CANNOT_LOAD_AS_VAULT_CONFIG = _prepare_translatable(
648)         comments=r"""
649)         TRANSLATORS: "fmt" is a string such as "v0.2" or "storeroom",
650)         indicating the format which we tried to load the vault
651)         configuration as.
652)         """,
653)         msg='Cannot load {path!r} as a {fmt!s} vault configuration.',
654)         context='info message',
655)         flags='python-brace-format',
656)     )
657)     PIP_INSTALL_EXTRA = _prepare_translatable(
658)         comments=r"""
659)         TRANSLATORS: This message immediately follows an error message
660)         about a missing library that needs to be installed.  The Python
661)         Package Index (PyPI) supports declaring sets of optional
662)         dependencies as "extras", so users installing from PyPI can
663)         request reinstallation with a named "extra" being enabled.  This
664)         would then let the installer take care of the missing libraries
665)         automatically, hence this suggestion to PyPI users.
666)         """,
667)         msg='(For users installing from PyPI, see the {extra_name!r} extra.)',
668)         context='info message',
669)         flags='python-brace-format',
670)     )
671)     SUCCESSFULLY_MIGRATED = _prepare_translatable(
672)         comments=r"""
673)         TRANSLATORS: This info message immediately follows the "Using
674)         deprecated v0.1-style ..." deprecation warning.
675)         """,
676)         msg='Successfully migrated to {path!r}.',
677)         context='info message',
678)         flags='python-brace-format',
679)     )
680) 
681) 
682) class WarnMsgTemplate(enum.Enum):
683)     EMPTY_SERVICE_NOT_SUPPORTED = _prepare_translatable(
684)         comments='',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

685)         msg="""
686)         An empty {service_metavar!s} is not supported by vault(1).
687)         For compatibility, this will be treated as if SERVICE was not
688)         supplied, i.e., it will error out, or operate on global settings.
689)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

690)         context='warning message',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

691)         flags='python-brace-format',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

692)     )
693)     EMPTY_SERVICE_SETTINGS_INACCESSIBLE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

694)         msg="""
695)         An empty {service_metavar!s} is not supported by vault(1).
696)         The empty-string service settings will be inaccessible and
697)         ineffective.  To ensure that vault(1) and {PROG_NAME!s} see the
698)         settings, move them into the "global" section.
699)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

700)         comments='',
701)         context='warning message',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

702)         flags='python-brace-format',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

703)     )
704)     FAILED_TO_MIGRATE_CONFIG = _prepare_translatable(
705)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

706)         TRANSLATORS: "error" is supplied by the operating system
707)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

708)         """,
709)         msg='Failed to migrate to {path!r}: {error!s}: {filename!r}.',
710)         context='warning message',
711)         flags='python-brace-format',
712)     )
713)     GLOBAL_PASSPHRASE_INEFFECTIVE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

714)         msg=r"""
715)         Setting a global passphrase is ineffective
716)         because a key is also set.
717)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

718)         comments='',
719)         context='warning message',
720)     )
721)     PASSPHRASE_NOT_NORMALIZED = _prepare_translatable(
722)         comments=r"""
723)         TRANSLATORS: The key is a (vault) configuration key, in JSONPath
724)         syntax, typically "$.global" for the global passphrase or
725)         "$.services.service_name" or "$.services["service with spaces"]"
726)         for the services "service_name" and "service with spaces",
727)         respectively.  The form is one of the four Unicode normalization
728)         forms: NFC, NFD, NFKC, NFKD.
729) 
730)         The asterisks are not special.  Please feel free to substitute
731)         any other appropriate way to mark up emphasis of the word
732)         "displays".
733)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

734)         msg=r"""
735)         The {key!s} passphrase is not {form!s}-normalized.  Its
736)         serialization as a byte string may not be what you expect it to
737)         be, even if it *displays* correctly.  Please make sure to
738)         double-check any derived passphrases for unexpected results.
739)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

740)         context='warning message',
741)         flags='python-brace-format',
742)     )
743)     SERVICE_PASSPHRASE_INEFFECTIVE = _prepare_translatable(
744)         comments=r"""
745)         TRANSLATORS: The key that is set need not necessarily be set at
746)         the service level; it may be a global key as well.
747)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

748)         msg=r"""
749)         Setting a service passphrase is ineffective because a key is
750)         also set: {service!s}.
751)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

752)         context='warning message',
753)         flags='python-brace-format',
754)     )
755)     STEP_REMOVE_INEFFECTIVE_VALUE = _prepare_translatable(
756)         'Removing ineffective setting {path!s} = {old!s}.',
757)         comments='',
758)         context='warning message',
759)         flags='python-brace-format',
760)     )
761)     STEP_REPLACE_INVALID_VALUE = _prepare_translatable(
762)         'Replacing invalid value {old!s} for key {path!s} with {new!s}.',
763)         comments='',
764)         context='warning message',
765)         flags='python-brace-format',
766)     )
767)     V01_STYLE_CONFIG = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

768)         msg=r"""
769)         Using deprecated v0.1-style config file {old!r}, instead of
770)         v0.2-style {new!r}.  Support for v0.1-style config filenames
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

771)         will be removed in v1.0.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

772)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

773)         comments='',
774)         context='deprecation warning message',
775)         flags='python-brace-format',
776)     )
777)     V10_SUBCOMMAND_REQUIRED = _prepare_translatable(
778)         comments=r"""
779)         TRANSLATORS: This deprecation warning may be issued at any
780)         level, i.e. we may actually be talking about subcommands, or
781)         sub-subcommands, or sub-sub-subcommands, etc., which is what the
782)         "here" is supposed to indicate.
783)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

784)         msg="""
785)         A subcommand will be required here in v1.0.  See --help for
786)         available subcommands.  Defaulting to subcommand "vault".
787)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

788)         context='deprecation warning message',
789)     )
790) 
791) 
792) class ErrMsgTemplate(enum.Enum):
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

793)     AGENT_REFUSED_LIST_KEYS = _prepare_translatable(
794)         comments=r"""
795)         TRANSLATORS: "loaded keys" being keys loaded into the agent.
796)         """,
797)         msg="""
798)         The SSH agent failed to or refused to supply a list of loaded keys.
799)         """,
800)         context='error message',
801)     )
802)     AGENT_REFUSED_SIGNATURE = _prepare_translatable(
803)         comments=r"""
804)         TRANSLATORS: The message to be signed is the vault UUID, but
805)         there's no space to explain that here, so ideally the error
806)         message does not go into detail.
807)         """,
808)         msg="""
809)         The SSH agent failed to or refused to issue a signature with the
810)         selected key, necessary for deriving a service passphrase.
811)         """,
812)         context='error message',
813)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

814)     CANNOT_CONNECT_TO_AGENT = _prepare_translatable(
815)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

816)         TRANSLATORS: "error" is supplied by the operating system
817)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

818)         """,
819)         msg='Cannot connect to the SSH agent: {error!s}: {filename!r}.',
820)         context='error message',
821)         flags='python-brace-format',
822)     )
823)     CANNOT_DECODEIMPORT_VAULT_SETTINGS = _prepare_translatable(
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

824)         comments=r"""
825)         TRANSLATORS: "error" is supplied by the operating system
826)         (errno/strerror).
827)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

828)         msg='Cannot import vault settings: cannot decode JSON: {error!s}.',
829)         context='error message',
830)         flags='python-brace-format',
831)     )
832)     CANNOT_EXPORT_VAULT_SETTINGS = _prepare_translatable(
833)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

834)         TRANSLATORS: "error" is supplied by the operating system
835)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

836)         """,
837)         msg='Cannot export vault settings: {error!s}: {filename!r}.',
838)         context='error message',
839)         flags='python-brace-format',
840)     )
841)     CANNOT_IMPORT_VAULT_SETTINGS = _prepare_translatable(
842)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

843)         TRANSLATORS: "error" is supplied by the operating system
844)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

845)         """,
846)         msg='Cannot import vault settings: {error!s}: {filename!r}.',
847)         context='error message',
848)         flags='python-brace-format',
849)     )
850)     CANNOT_LOAD_USER_CONFIG = _prepare_translatable(
851)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

852)         TRANSLATORS: "error" is supplied by the operating system
853)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

854)         """,
855)         msg='Cannot load user config: {error!s}: {filename!r}.',
856)         context='error message',
857)         flags='python-brace-format',
858)     )
859)     CANNOT_LOAD_VAULT_SETTINGS = _prepare_translatable(
860)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

861)         TRANSLATORS: "error" is supplied by the operating system
862)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

863)         """,
864)         msg='Cannot load vault settings: {error!s}: {filename!r}.',
865)         context='error message',
866)         flags='python-brace-format',
867)     )
868)     CANNOT_PARSE_AS_VAULT_CONFIG = _prepare_translatable(
869)         comments=r"""
870)         TRANSLATORS: Unlike the "Cannot load {path!r} as a {fmt!s} vault
871)         configuration." message, *this* error message is emitted when we
872)         have tried loading the path in each of our supported formats,
873)         and failed.  The user will thus see the above "Cannot load ..."
874)         warning message potentially multiple times, and this error
875)         message at the very bottom.
876)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

877)         msg=r"""
878)         Cannot parse {path!r} as a valid vault-native configuration
879)         file/directory.
880)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

881)         context='error message',
882)         flags='python-brace-format',
883)     )
884)     CANNOT_STORE_VAULT_SETTINGS = _prepare_translatable(
885)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

886)         TRANSLATORS: "error" is supplied by the operating system
887)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

888)         """,
889)         msg='Cannot store vault settings: {error!s}: {filename!r}.',
890)         context='error message',
891)         flags='python-brace-format',
892)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

893)     CANNOT_UNDERSTAND_AGENT = _prepare_translatable(
894)         comments=r"""
895)         TRANSLATORS: This error message is used whenever we cannot make
896)         any sense of a response from the SSH agent because the response
897)         is ill-formed (truncated, improperly encoded, etc.) or otherwise
898)         violates the communications protocol.  Well-formed responses
899)         that adhere to the protocol, even if they indicate that the
900)         requested operation failed, are handled with a different error
901)         message.
902)         """,
903)         msg="""
904)         Cannot understand the SSH agent's response because it violates
905)         the communications protocol.
906)         """,
907)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

908)     CANNOT_UPDATE_SETTINGS_NO_SETTINGS = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

909)         msg=r"""
910)         Cannot update {settings_type!s} settings without any given
911)         settings.  You must specify at least one of --lower, ...,
912)         --symbol, or --phrase or --key.
913)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

914)         comments='',
915)         context='error message',
916)         flags='python-brace-format',
917)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

918)     INVALID_USER_CONFIG = _prepare_translatable(
919)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

920)         TRANSLATORS: "error" is supplied by the operating system
921)         (errno/strerror).
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

922)         """,
923)         msg=r"""
924)         The user configuration file is invalid.  {error!s}: {filename!r}.
925)         """,
926)         context='error message',
927)         flags='python-brace-format',
928)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

929)     INVALID_VAULT_CONFIG = _prepare_translatable(
930)         comments=r"""
931)         TRANSLATORS: This error message is a reaction to a validator
932)         function saying *that* the configuration is not valid, but not
933)         *how* it is not valid.  The configuration file is principally
934)         parsable, however.
935)         """,
936)         msg='Invalid vault config: {config!r}.',
937)         context='error message',
938)         flags='python-brace-format',
939)     )
940)     MISSING_MODULE = _prepare_translatable(
941)         'Cannot load the required Python module {module!r}.',
942)         comments='',
943)         context='error message',
944)         flags='python-brace-format',
945)     )
946)     NO_AF_UNIX = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

947)         msg=r"""
948)         Cannot connect to an SSH agent because this Python version does
949)         not support UNIX domain sockets.
950)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

951)         comments='',
952)         context='error message',
953)     )
954)     NO_KEY_OR_PHRASE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

955)         msg=r"""
956)         No passphrase or key was given in the configuration.  In this
957)         case, the --phrase or --key argument is required.
958)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

959)         comments='',
960)         context='error message',
961)     )
962)     NO_SSH_AGENT_FOUND = _prepare_translatable(
963)         'Cannot find any running SSH agent because SSH_AUTH_SOCK is not set.',
964)         comments='',
965)         context='error message',
966)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

967)     NO_SUITABLE_SSH_KEYS = _prepare_translatable(
968)         msg="""
969)         The SSH agent contains no keys suitable for {PROG_NAME!s}.
970)         """,  # noqa: RUF027
971)         comments='',
972)         context='error message',
973)         flags='python-brace-format',
974)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

975)     PARAMS_MUTUALLY_EXCLUSIVE = _prepare_translatable(
976)         comments=r"""
977)         TRANSLATORS: The params are long-form command-line option names.
978)         Typical example: "--key is mutually exclusive with --phrase."
979)         """,
980)         msg='{param1!s} is mutually exclusive with {param2!s}.',
981)         context='error message',
982)         flags='python-brace-format',
983)     )
984)     PARAMS_NEEDS_SERVICE_OR_CONFIG = _prepare_translatable(
985)         comments=r"""
986)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

987)         the metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

988)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

989)         msg='{param!s} requires a {service_metavar!s} or --config.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

990)         context='error message',
991)         flags='python-brace-format',
992)     )
993)     PARAMS_NEEDS_SERVICE = _prepare_translatable(
994)         comments=r"""
995)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

996)         the metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

997)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

998)         msg='{param!s} requires a {service_metavar!s}.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

999)         context='error message',
1000)         flags='python-brace-format',
1001)     )
1002)     PARAMS_NO_SERVICE = _prepare_translatable(
1003)         comments=r"""
1004)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

1005)         the metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1006)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1007)         msg='{param!s} does not take a {service_metavar!s} argument.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1008)         context='error message',
1009)         flags='python-brace-format',
1010)     )
1011)     SERVICE_REQUIRED = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1012)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

1013)         TRANSLATORS: The metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1014)         """,
1015)         msg='Deriving a passphrase requires a {service_metavar!s}.',
1016)         context='error message',
1017)         flags='python-brace-format',
1018)     )
1019)     SET_AND_UNSET_SAME_SETTING = _prepare_translatable(
1020)         comments=r"""
1021)         TRANSLATORS: The rephrasing "Attempted to unset and set the same
1022)         setting (--unset={setting!s} --{setting!s}=...) at the same
1023)         time." may or may not be more suitable as a basis for
1024)         translation instead.
1025)         """,
1026)         msg='Attempted to unset and set --{setting!s} at the same time.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1027)         context='error message',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1028)         flags='python-brace-format',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1029)     )
1030)     SSH_KEY_NOT_LOADED = _prepare_translatable(
1031)         'The requested SSH key is not loaded into the agent.',
1032)         comments='',
1033)         context='error message',
1034)     )
1035)     USER_ABORTED_EDIT = _prepare_translatable(
1036)         'Not saving any new notes: the user aborted the request.',
1037)         comments='',
1038)         context='error message',
1039)     )
1040)     USER_ABORTED_PASSPHRASE = _prepare_translatable(
1041)         'No passphrase was given; the user aborted the request.',
1042)         comments='',
1043)         context='error message',
1044)     )
1045)     USER_ABORTED_SSH_KEY_SELECTION = _prepare_translatable(
1046)         'No SSH key was selected; the user aborted the request.',
1047)         comments='',
1048)         context='error message',
1049)     )