73f1128336d79d6f1ee0d8d783d58d6c6d629cc3
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 Provide a function to reloa...

Marco Ricci authored 1 week ago

9) import contextlib
Marco Ricci Add a writer function for d...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

11) import enum
12) import gettext
13) import inspect
Marco Ricci Provide a function to reloa...

Marco Ricci authored 1 week ago

14) import os
15) import sys
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

19) 
20) import derivepassphrase as dpp
21) 
22) if TYPE_CHECKING:
Marco Ricci Provide a function to reloa...

Marco Ricci authored 1 week ago

23)     from collections.abc import Iterable, Mapping, Sequence
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

24) 
25)     from typing_extensions import Any, Self
26) 
27) __author__ = dpp.__author__
28) __version__ = dpp.__version__
29) 
30) __all__ = ('PROG_NAME',)
31) 
32) PROG_NAME = 'derivepassphrase'
Marco Ricci Provide a function to reloa...

Marco Ricci authored 1 week ago

33) 
34) 
35) def load_translations(
36)     localedirs: list[str] | None = None,
37)     languages: Sequence[str] | None = None,
38)     class_: type[gettext.NullTranslations] | None = None,
39) ) -> gettext.NullTranslations:
40)     """Load a translation catalog for derivepassphrase.
41) 
42)     Runs [`gettext.translation`][] under the hood for multiple locale
43)     directories.  `fallback=True` is implied.
44) 
45)     Args:
46)         localedirs:
47)             A list of directories to run [`gettext.translation`][]
48)             against.  Defaults to `$XDG_DATA_HOME/locale` (usually
49)             `~/.local/share/locale`), `{sys.prefix}/share/locale` and
50)             `{sys.base_prefix}/share/locale` if not given.
51)         languages:
52)             Passed directly to [`gettext.translation`][].
53)         class_:
54)             Passed directly to [`gettext.translation`][].
55) 
56)     Returns:
57)         A (potentially dummy) translation catalog.
58) 
59)     """
60)     if localedirs is None:
61)         if sys.platform.startswith('win'):
62)             xdg_data_home = os.environ.get(
63)                 'APPDATA',
64)                 os.path.expanduser('~'),
65)             )
66)         elif os.environ.get('XDG_DATA_HOME'):
67)             xdg_data_home = os.environ['XDG_DATA_HOME']
68)         else:
69)             xdg_data_home = os.path.join(
70)                 os.path.expanduser('~'), '.local', 'share'
71)             )
72)         localedirs = [
73)             os.path.join(xdg_data_home, 'locale'),
74)             os.path.join(sys.prefix, 'share', 'locale'),
75)             os.path.join(sys.base_prefix, 'share', 'locale'),
76)         ]
77)     for localedir in localedirs:
78)         with contextlib.suppress(OSError):
79)             return gettext.translation(
80)                 PROG_NAME,
81)                 localedir=localedir,
82)                 languages=languages,
83)                 class_=class_,
84)             )
85)     return gettext.NullTranslations()
86) 
87) 
88) translation = load_translations()
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

89) 
90) 
91) class TranslatableString(NamedTuple):
92)     singular: str
93)     plural: str
94)     l10n_context: str
95)     translator_comments: str
96)     flags: frozenset[str]
97) 
98) 
99) def _prepare_translatable(
100)     msg: str,
101)     comments: str = '',
102)     context: str = '',
103)     plural_msg: str = '',
104)     *,
105)     flags: Iterable[str] = (),
106) ) -> TranslatableString:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

107)     def maybe_rewrap(string: str) -> str:
108)         string = inspect.cleandoc(string)
109)         if not any(s.strip() == '\b' for s in string.splitlines()):
110)             string = '\n'.join(
111)                 textwrap.wrap(
112)                     string,
113)                     width=float('inf'),  # type: ignore[arg-type]
114)                     fix_sentence_endings=True,
115)                 )
116)             )
117)         else:  # pragma: no cover
118)             string = ''.join(
119)                 s
120)                 for s in string.splitlines(True)  # noqa: FBT003
121)                 if s.strip() == '\b'
122)             )
123)         return string
124) 
125)     msg = maybe_rewrap(msg)
126)     plural_msg = maybe_rewrap(plural_msg)
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

127)     context = context.strip()
128)     comments = inspect.cleandoc(comments)
129)     flags = (
130)         frozenset(f.strip() for f in flags)
131)         if not isinstance(flags, str)
132)         else frozenset({flags})
133)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

139)     ), 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

140)     assert (
141)         not flags & {'python-format', 'python-brace-format'}
142)         or '%' in msg
143)         or '{' in msg
144)     ), f'Missing format string parameters in {msg!r}'
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

145)     return TranslatableString(msg, plural_msg, context, comments, flags)
146) 
147) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

149)     def __init__(
150)         self,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

151)         template: (
152)             str
153)             | TranslatableString
154)             | Label
155)             | InfoMsgTemplate
156)             | WarnMsgTemplate
157)             | ErrMsgTemplate
158)         ),
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

159)         args_dict: Mapping[str, Any] = types.MappingProxyType({}),
160)         /,
161)         **kwargs: Any,  # noqa: ANN401
162)     ) -> None:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

163)         if isinstance(
164)             template, (Label, InfoMsgTemplate, WarnMsgTemplate, ErrMsgTemplate)
165)         ):
166)             template = cast(TranslatableString, template.value)
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

167)         self.template = template
168)         self.kwargs = {**args_dict, **kwargs}
169)         self._rendered: str | None = None
170) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

171)     def __bool__(self) -> bool:
172)         return bool(str(self))
173) 
174)     def __eq__(self, other: object) -> bool:  # pragma: no cover
175)         return str(self) == other
176) 
177)     def __hash__(self) -> int:  # pragma: no cover
178)         return hash(str(self))
179) 
180)     def __repr__(self) -> str:  # pragma: no cover
181)         return (
182)             f'{self.__class__.__name__}({self.template!r}, '
183)             f'{dict(self.kwargs)!r})'
184)         )
185) 
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

188)             # raw str support is currently unneeded, so excluded from coverage
189)             if isinstance(self.template, str):  # pragma: no cover
190)                 context = None
191)                 template = self.template
192)             else:
193)                 context = self.template.l10n_context
194)                 template = self.template.singular
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

198)                 template = translation.gettext(template)
199)             self._rendered = template.format(**self.kwargs)
200)         return self._rendered
201) 
202)     def maybe_without_filename(self) -> Self:
203)         if (
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

206)             and ': {filename!r}' in self.template.singular
207)         ):
208)             singular = ''.join(
209)                 self.template.singular.split(': {filename!r}', 1)
210)             )
211)             plural = (
212)                 ''.join(self.template.plural.split(': {filename!r}', 1))
213)                 if self.template.plural
214)                 else self.template.plural
215)             )
216)             return self.__class__(
217)                 self.template._replace(singular=singular, plural=plural),
218)                 self.kwargs,
219)             )
220)         return self
221) 
222) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

223) class Label(enum.Enum):
224)     DEPRECATION_WARNING_LABEL = _prepare_translatable(
225)         'Deprecation warning', comments='', context='diagnostic label'
226)     )
227)     WARNING_LABEL = _prepare_translatable(
228)         'Warning', comments='', context='diagnostic label'
229)     )
230)     DERIVEPASSPHRASE_01 = _prepare_translatable(
231)         msg="""
232)         Derive a strong passphrase, deterministically, from a master secret.
233)         """,
234)         comments='',
235)         context='help text (long form)',
236)     )
237)     DERIVEPASSPHRASE_02 = _prepare_translatable(
238)         msg="""
239)         The currently implemented subcommands are "vault" (for the
240)         scheme used by vault) and "export" (for exporting foreign
241)         configuration data).  See the respective `--help` output for
242)         instructions.  If no subcommand is given, we default to "vault".
243)         """,
244)         comments='',
245)         context='help text (long form)',
246)     )
247)     DERIVEPASSPHRASE_03 = _prepare_translatable(
248)         msg="""
249)         Deprecation notice: Defaulting to "vault" is deprecated.
250)         Starting in v1.0, the subcommand must be specified explicitly.
251)         """,
252)         comments='',
253)         context='help text (long form)',
254)     )
255)     DERIVEPASSPHRASE_EPILOG_01 = _prepare_translatable(
256)         msg=r"""
257)         Configuration is stored in a directory according to the
258)         `DERIVEPASSPHRASE_PATH` variable, which defaults to
259)         `~/.derivepassphrase` on UNIX-like systems and
260)         `C:\Users\<user>\AppData\Roaming\Derivepassphrase` on Windows.
261)         """,
262)         comments='',
263)         context='help text (long form)',
264)     )
265)     DERIVEPASSPHRASE_EXPORT_01 = _prepare_translatable(
266)         msg="""
267)         Export a foreign configuration to standard output.
268)         """,
269)         comments='',
270)         context='help text (long form)',
271)     )
272)     DERIVEPASSPHRASE_EXPORT_02 = _prepare_translatable(
273)         msg="""
274)         The only available subcommand is "vault", which implements the
275)         vault-native configuration scheme.  If no subcommand is given,
276)         we default to "vault".
277)         """,
278)         comments='',
279)         context='help text (long form)',
280)     )
281)     DERIVEPASSPHRASE_EXPORT_03 = DERIVEPASSPHRASE_03
282)     DERIVEPASSPHRASE_EXPORT_VAULT_01 = _prepare_translatable(
283)         msg="""
284)         Export a vault-native configuration to standard output.
285)         """,
286)         comments='',
287)         context='help text (long form)',
288)     )
289)     DERIVEPASSPHRASE_EXPORT_VAULT_02 = _prepare_translatable(
290)         msg="""
291)         Depending on the configuration format, {path_metavar!s} may
292)         either be a file or a directory.  We support the vault "v0.2",
293)         "v0.3" and "storeroom" formats.
294)         """,
295)         comments='',
296)         context='help text (long form)',
297)         flags='python-brace-format',
298)     )
299)     DERIVEPASSPHRASE_EXPORT_VAULT_03 = _prepare_translatable(
300)         msg="""
301)         If {path_metavar!s} is explicitly given as `VAULT_PATH`, then
302)         use the `VAULT_PATH` environment variable to determine the
303)         correct path.  (Use `./VAULT_PATH` or similar to indicate
304)         a file/directory actually named `VAULT_PATH`.)
305)         """,
306)         comments='',
307)         context='help text (long form)',
308)         flags='python-brace-format',
309)     )
310)     DERIVEPASSPHRASE_VAULT_01 = _prepare_translatable(
311)         msg="""
312)         Derive a passphrase using the vault derivation scheme.
313)         """,
314)         comments='',
315)         context='help text (long form)',
316)     )
317)     DERIVEPASSPHRASE_VAULT_02 = _prepare_translatable(
318)         msg="""
319)         If operating on global settings, or importing/exporting
320)         settings, then {service_metavar!s} must be omitted.  Otherwise
321)         it is required.
322)         """,
323)         comments='',
324)         context='help text (long form)',
325)         flags='python-brace-format',
326)     )
327)     DERIVEPASSPHRASE_VAULT_EPILOG_01 = _prepare_translatable(
328)         msg="""
329)         WARNING: There is NO WAY to retrieve the generated passphrases
330)         if the master passphrase, the SSH key, or the exact passphrase
331)         settings are lost, short of trying out all possible
332)         combinations.  You are STRONGLY advised to keep independent
333)         backups of the settings and the SSH key, if any.
334)         """,
335)         comments='',
336)         context='help text (long form)',
337)     )
338)     DERIVEPASSPHRASE_VAULT_EPILOG_02 = _prepare_translatable(
339)         msg="""
340)         The configuration is NOT encrypted, and you are STRONGLY
341)         discouraged from using a stored passphrase.
342)         """,
343)         comments='',
344)         context='help text (long form)',
345)     )
346)     DEPRECATED_COMMAND_LABEL = _prepare_translatable(
347)         msg='(Deprecated) {text}',
348)         comments='',
349)         context='help text (long form, label)',
350)         flags='python-brace-format',
351)     )
352)     DEBUG_OPTION_HELP_TEXT = _prepare_translatable(
353)         'also emit debug information (implies --verbose)',
354)         comments='',
355)         context='help text (option one-line description)',
356)     )
357)     EXPORT_VAULT_FORMAT_HELP_TEXT = _prepare_translatable(
358)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

359)         TRANSLATORS: The defaults_hint is
360)         Label.EXPORT_VAULT_FORMAT_DEFAULTS_HELP_TEXT, the metavar is
361)         Label.EXPORT_VAULT_FORMAT_METAVAR_FMT.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

362)         """,
363)         msg=r"""
364)         try the following storage format {metavar!s}; may be
365)         specified multiple times, formats will be tried in order
366)         {defaults_hint!s}
367)         """,
368)         context='help text (option one-line description)',
369)         flags='python-brace-format',
370)     )
371)     EXPORT_VAULT_FORMAT_DEFAULTS_HELP_TEXT = _prepare_translatable(
372)         comments=r"""
373)         TRANSLATORS: See EXPORT_VAULT_FORMAT_HELP_TEXT.  The format
374)         names/labels "v0.3", "v0.2" and "storeroom" should not be
375)         translated.
376)         """,
377)         msg=r"""
378)         (default: v0.3, v0.2, storeroom)
379)         """,
380)         context='help text (option one-line description)',
381)     )
382)     EXPORT_VAULT_KEY_HELP_TEXT = _prepare_translatable(
383)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

384)         TRANSLATORS: The defaults_hint is
385)         Label.EXPORT_VAULT_KEY_DEFAULTS_HELP_TEXT, the metavar is
386)         Label.EXPORT_VAULT_KEY_METAVAR_K.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

387)         """,
388)         msg=r"""
389)         use {metavar!s} as the storage master key {defaults_hint!s}
390)         """,
391)         context='help text (option one-line description)',
392)         flags='python-brace-format',
393)     )
394)     EXPORT_VAULT_KEY_DEFAULTS_HELP_TEXT = _prepare_translatable(
395)         comments=r"""
396)         TRANSLATORS: See EXPORT_VAULT_KEY_HELP_TEXT.
397)         """,
398)         msg=r"""
399)         (default: check the `VAULT_KEY`, `LOGNAME`, `USER`, or
400)         `USERNAME` environment variables)
401)         """,
402)         context='help text (option one-line description)',
403)     )
404)     QUIET_OPTION_HELP_TEXT = _prepare_translatable(
405)         'suppress even warnings, emit only errors',
406)         comments='',
407)         context='help text (option one-line description)',
408)     )
409)     VERBOSE_OPTION_HELP_TEXT = _prepare_translatable(
410)         'emit extra/progress information to standard error',
411)         comments='',
412)         context='help text (option one-line description)',
413)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

414) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

415)     DERIVEPASSPHRASE_VAULT_PHRASE_HELP_TEXT = _prepare_translatable(
416)         msg='prompt for a master passphrase',
417)         comments='',
418)         context='help text (option one-line description)',
419)     )
420)     DERIVEPASSPHRASE_VAULT_KEY_HELP_TEXT = _prepare_translatable(
421)         msg='select a suitable SSH key from the SSH agent',
422)         comments='',
423)         context='help text (option one-line description)',
424)     )
425)     DERIVEPASSPHRASE_VAULT_LENGTH_HELP_TEXT = _prepare_translatable(
426)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

427)         TRANSLATORS: The metavar is
428)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

429)         """,
430)         msg='ensure a passphrase length of {metavar!s} characters',
431)         context='help text (option one-line description)',
432)         flags='python-brace-format',
433)     )
434)     DERIVEPASSPHRASE_VAULT_REPEAT_HELP_TEXT = _prepare_translatable(
435)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

436)         TRANSLATORS: The metavar is
437)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

438)         """,
439)         msg='forbid any run of {metavar!s} identical characters',
440)         context='help text (option one-line description)',
441)         flags='python-brace-format',
442)     )
443)     DERIVEPASSPHRASE_VAULT_LOWER_HELP_TEXT = _prepare_translatable(
444)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

445)         TRANSLATORS: The metavar is
446)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

447)         """,
448)         msg='ensure at least {metavar!s} lowercase characters',
449)         context='help text (option one-line description)',
450)         flags='python-brace-format',
451)     )
452)     DERIVEPASSPHRASE_VAULT_UPPER_HELP_TEXT = _prepare_translatable(
453)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

454)         TRANSLATORS: The metavar is
455)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

456)         """,
457)         msg='ensure at least {metavar!s} uppercase characters',
458)         context='help text (option one-line description)',
459)         flags='python-brace-format',
460)     )
461)     DERIVEPASSPHRASE_VAULT_NUMBER_HELP_TEXT = _prepare_translatable(
462)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

463)         TRANSLATORS: The metavar is
464)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

465)         """,
466)         msg='ensure at least {metavar!s} digits',
467)         context='help text (option one-line description)',
468)         flags='python-brace-format',
469)     )
470)     DERIVEPASSPHRASE_VAULT_SPACE_HELP_TEXT = _prepare_translatable(
471)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

472)         TRANSLATORS: The metavar is
473)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

474)         """,
475)         msg='ensure at least {metavar!s} spaces',
476)         context='help text (option one-line description)',
477)         flags='python-brace-format',
478)     )
479)     DERIVEPASSPHRASE_VAULT_DASH_HELP_TEXT = _prepare_translatable(
480)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

481)         TRANSLATORS: The metavar is
482)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

483)         """,
484)         msg='ensure at least {metavar!s} "-" or "_" characters',
485)         context='help text (option one-line description)',
486)         flags='python-brace-format',
487)     )
488)     DERIVEPASSPHRASE_VAULT_SYMBOL_HELP_TEXT = _prepare_translatable(
489)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

490)         TRANSLATORS: The metavar is
491)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

492)         """,
493)         msg='ensure at least {metavar!s} symbol characters',
494)         context='help text (option one-line description)',
495)         flags='python-brace-format',
496)     )
497) 
498)     DERIVEPASSPHRASE_VAULT_NOTES_HELP_TEXT = _prepare_translatable(
499)         msg='spawn an editor to edit notes for {service_metavar!s}',
500)         comments='',
501)         context='help text (option one-line description)',
502)         flags='python-brace-format',
503)     )
504)     DERIVEPASSPHRASE_VAULT_CONFIG_HELP_TEXT = _prepare_translatable(
505)         msg='save the given settings for {service_metavar!s}, or global',
506)         comments='',
507)         context='help text (option one-line description)',
508)         flags='python-brace-format',
509)     )
510)     DERIVEPASSPHRASE_VAULT_DELETE_HELP_TEXT = _prepare_translatable(
511)         msg='delete the settings for {service_metavar!s}',
512)         comments='',
513)         context='help text (option one-line description)',
514)         flags='python-brace-format',
515)     )
516)     DERIVEPASSPHRASE_VAULT_DELETE_GLOBALS_HELP_TEXT = _prepare_translatable(
517)         msg='delete the global settings',
518)         comments='',
519)         context='help text (option one-line description)',
520)     )
521)     DERIVEPASSPHRASE_VAULT_DELETE_ALL_HELP_TEXT = _prepare_translatable(
522)         msg='delete all settings',
523)         comments='',
524)         context='help text (option one-line description)',
525)     )
526)     DERIVEPASSPHRASE_VAULT_EXPORT_HELP_TEXT = _prepare_translatable(
527)         comments="""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

528)         TRANSLATORS: The metavar is
529)         Label.STORAGE_MANAGEMENT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

530)         """,
531)         msg='export all saved settings to {metavar!s}',
532)         context='help text (option one-line description)',
533)         flags='python-brace-format',
534)     )
535)     DERIVEPASSPHRASE_VAULT_IMPORT_HELP_TEXT = _prepare_translatable(
536)         comments="""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

537)         TRANSLATORS: The metavar is
538)         Label.STORAGE_MANAGEMENT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

539)         """,
540)         msg='import saved settings from {metavar!s}',
541)         context='help text (option one-line description)',
542)         flags='python-brace-format',
543)     )
544)     DERIVEPASSPHRASE_VAULT_OVERWRITE_HELP_TEXT = _prepare_translatable(
545)         comments="""
546)         TRANSLATORS: The corresponding option is displayed as
547)         "--overwrite-existing / --merge-existing", so you may want to
548)         hint that the default (merge) is the second of those options.
549)         """,
550)         msg='overwrite or merge (default) the existing configuration',
551)         context='help text (option one-line description)',
552)     )
553)     DERIVEPASSPHRASE_VAULT_UNSET_HELP_TEXT = _prepare_translatable(
554)         comments="""
555)         TRANSLATORS: The corresponding option is displayed as
556)         "--unset=phrase|key|...|symbol", so the "given setting" is
557)         referring to "phrase", "key", "lower", ..., or "symbol",
558)         respectively.  "with --config" here means that the user must
559)         also specify "--config" for this option to have any effect.
560)         """,
561)         msg="""
562)         with --config, also unsets the given setting; may be specified
563)         multiple times
564)         """,
565)         context='help text (option one-line description)',
566)     )
567)     DERIVEPASSPHRASE_VAULT_EXPORT_AS_HELP_TEXT = _prepare_translatable(
568)         comments="""
569)         TRANSLATORS: The corresponding option is displayed as
570)         "--export-as=json|sh", so json refers to the JSON format
571)         (default) and sh refers to the POSIX sh format.
572)         """,
573)         msg='when exporting, export as JSON (default) or POSIX sh',
574)         context='help text (option one-line description)',
575)     )
576) 
577)     EXPORT_VAULT_FORMAT_METAVAR_FMT = _prepare_translatable(
578)         msg='FMT',
579)         comments='',
580)         context='help text, metavar (export vault subcommand)',
581)     )
582)     EXPORT_VAULT_KEY_METAVAR_K = _prepare_translatable(
583)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

585)         """,
586)         msg='K',
587)         context='help text, metavar (export vault subcommand)',
588)     )
589)     EXPORT_VAULT_METAVAR_PATH = _prepare_translatable(
590)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

593)         """,
594)         msg='PATH',
595)         context='help text, metavar (export vault subcommand)',
596)     )
597)     PASSPHRASE_GENERATION_METAVAR_NUMBER = _prepare_translatable(
598)         comments=r"""
599)         TRANSLATORS: This metavar is also used in a matching epilog.
600)         """,
601)         msg='NUMBER',
602)         context='help text, metavar (passphrase generation group)',
603)     )
604)     STORAGE_MANAGEMENT_METAVAR_PATH = _prepare_translatable(
605)         comments=r"""
606)         TRANSLATORS: This metavar is also used in multiple one-line help
607)         texts.
608)         """,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

610)         context='help text, metavar (storage management group)',
611)     )
612)     VAULT_METAVAR_SERVICE = _prepare_translatable(
613)         comments=r"""
614)         TRANSLATORS: This metavar is also used in multiple one-line help
615)         texts, as "service_metavar".
616)         """,
617)         msg='SERVICE',
618)         context='help text, metavar (vault subcommand)',
619)     )
620)     CONFIGURATION_EPILOG = _prepare_translatable(
621)         'Use $VISUAL or $EDITOR to configure the spawned editor.',
622)         comments='',
623)         context='help text, option group epilog (configuration group)',
624)     )
625)     PASSPHRASE_GENERATION_EPILOG = _prepare_translatable(
626)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

627)         TRANSLATORS: The metavar is
628)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

629)         """,
630)         msg=r"""
631)         Use {metavar!s}=0 to exclude a character type from the output.
632)         """,
633)         context='help text, option group epilog (passphrase generation group)',
634)         flags='python-brace-format',
635)     )
636)     STORAGE_MANAGEMENT_EPILOG = _prepare_translatable(
637)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

638)         TRANSLATORS: The metavar is
639)         Label.STORAGE_MANAGEMENT_METAVAR_PATH.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

640)         """,
641)         msg=r"""
642)         Using "-" as {metavar!s} for standard input/standard output
643)         is supported.
644)         """,
645)         context='help text, option group epilog (storage management group)',
646)         flags='python-brace-format',
647)     )
648)     COMMANDS_LABEL = _prepare_translatable(
649)         'Commands', comments='', context='help text, option group name'
650)     )
651)     COMPATIBILITY_OPTION_LABEL = _prepare_translatable(
652)         'Compatibility and extension options',
653)         comments='',
654)         context='help text, option group name',
655)     )
656)     CONFIGURATION_LABEL = _prepare_translatable(
657)         'Configuration', comments='', context='help text, option group name'
658)     )
659)     LOGGING_LABEL = _prepare_translatable(
660)         'Logging', comments='', context='help text, option group name'
661)     )
662)     OPTIONS_LABEL = _prepare_translatable(
663)         'Options', comments='', context='help text, option group name'
664)     )
665)     OTHER_OPTIONS_LABEL = _prepare_translatable(
666)         'Other options', comments='', context='help text, option group name'
667)     )
668)     PASSPHRASE_GENERATION_LABEL = _prepare_translatable(
669)         'Passphrase generation',
670)         comments='',
671)         context='help text, option group name',
672)     )
673)     STORAGE_MANAGEMENT_LABEL = _prepare_translatable(
674)         'Storage management',
675)         comments='',
676)         context='help text, option group name',
677)     )
678)     CONFIRM_THIS_CHOICE_PROMPT_TEXT = _prepare_translatable(
679)         comments=r"""
680)         TRANSLATORS: There is no support for "yes" or "no" in other
681)         languages than English, so it is advised that your translation
682)         makes it clear that only the strings "y", "yes", "n" or "no" are
683)         supported, even if the prompt becomes a bit longer.
684)         """,
685)         msg='Confirm this choice? (y/N)',
686)         context='interactive prompt',
687)     )
688)     SUITABLE_SSH_KEYS_LABEL = _prepare_translatable(
689)         comments=r"""
690)         TRANSLATORS: This label is the heading of the list of suitable
691)         SSH keys.
692)         """,
693)         msg='Suitable SSH keys:',
694)         context='interactive prompt',
695)     )
696)     YOUR_SELECTION_PROMPT_TEXT = _prepare_translatable(
697)         'Your selection? (1-{n}, leave empty to abort)',
698)         comments='',
699)         context='interactive prompt',
700)         flags='python-brace-format',
701)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

702) 
703) 
704) class InfoMsgTemplate(enum.Enum):
705)     CANNOT_LOAD_AS_VAULT_CONFIG = _prepare_translatable(
706)         comments=r"""
707)         TRANSLATORS: "fmt" is a string such as "v0.2" or "storeroom",
708)         indicating the format which we tried to load the vault
709)         configuration as.
710)         """,
711)         msg='Cannot load {path!r} as a {fmt!s} vault configuration.',
712)         context='info message',
713)         flags='python-brace-format',
714)     )
715)     PIP_INSTALL_EXTRA = _prepare_translatable(
716)         comments=r"""
717)         TRANSLATORS: This message immediately follows an error message
718)         about a missing library that needs to be installed.  The Python
719)         Package Index (PyPI) supports declaring sets of optional
720)         dependencies as "extras", so users installing from PyPI can
721)         request reinstallation with a named "extra" being enabled.  This
722)         would then let the installer take care of the missing libraries
723)         automatically, hence this suggestion to PyPI users.
724)         """,
725)         msg='(For users installing from PyPI, see the {extra_name!r} extra.)',
726)         context='info message',
727)         flags='python-brace-format',
728)     )
729)     SUCCESSFULLY_MIGRATED = _prepare_translatable(
730)         comments=r"""
731)         TRANSLATORS: This info message immediately follows the "Using
732)         deprecated v0.1-style ..." deprecation warning.
733)         """,
734)         msg='Successfully migrated to {path!r}.',
735)         context='info message',
736)         flags='python-brace-format',
737)     )
738) 
739) 
740) class WarnMsgTemplate(enum.Enum):
741)     EMPTY_SERVICE_NOT_SUPPORTED = _prepare_translatable(
742)         comments='',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

750)     )
751)     EMPTY_SERVICE_SETTINGS_INACCESSIBLE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

752)         msg="""
753)         An empty {service_metavar!s} is not supported by vault(1).
754)         The empty-string service settings will be inaccessible and
755)         ineffective.  To ensure that vault(1) and {PROG_NAME!s} see the
756)         settings, move them into the "global" section.
757)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

758)         comments='',
759)         context='warning message',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

761)     )
762)     FAILED_TO_MIGRATE_CONFIG = _prepare_translatable(
763)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

766)         """,
767)         msg='Failed to migrate to {path!r}: {error!s}: {filename!r}.',
768)         context='warning message',
769)         flags='python-brace-format',
770)     )
771)     GLOBAL_PASSPHRASE_INEFFECTIVE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

772)         msg=r"""
773)         Setting a global passphrase is ineffective
774)         because a key is also set.
775)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

776)         comments='',
777)         context='warning message',
778)     )
779)     PASSPHRASE_NOT_NORMALIZED = _prepare_translatable(
780)         comments=r"""
781)         TRANSLATORS: The key is a (vault) configuration key, in JSONPath
782)         syntax, typically "$.global" for the global passphrase or
783)         "$.services.service_name" or "$.services["service with spaces"]"
784)         for the services "service_name" and "service with spaces",
785)         respectively.  The form is one of the four Unicode normalization
786)         forms: NFC, NFD, NFKC, NFKD.
787) 
788)         The asterisks are not special.  Please feel free to substitute
789)         any other appropriate way to mark up emphasis of the word
790)         "displays".
791)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

798)         context='warning message',
799)         flags='python-brace-format',
800)     )
801)     SERVICE_PASSPHRASE_INEFFECTIVE = _prepare_translatable(
802)         comments=r"""
803)         TRANSLATORS: The key that is set need not necessarily be set at
804)         the service level; it may be a global key as well.
805)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

806)         msg=r"""
807)         Setting a service passphrase is ineffective because a key is
808)         also set: {service!s}.
809)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

810)         context='warning message',
811)         flags='python-brace-format',
812)     )
813)     STEP_REMOVE_INEFFECTIVE_VALUE = _prepare_translatable(
814)         'Removing ineffective setting {path!s} = {old!s}.',
815)         comments='',
816)         context='warning message',
817)         flags='python-brace-format',
818)     )
819)     STEP_REPLACE_INVALID_VALUE = _prepare_translatable(
820)         'Replacing invalid value {old!s} for key {path!s} with {new!s}.',
821)         comments='',
822)         context='warning message',
823)         flags='python-brace-format',
824)     )
825)     V01_STYLE_CONFIG = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

831)         comments='',
832)         context='deprecation warning message',
833)         flags='python-brace-format',
834)     )
835)     V10_SUBCOMMAND_REQUIRED = _prepare_translatable(
836)         comments=r"""
837)         TRANSLATORS: This deprecation warning may be issued at any
838)         level, i.e. we may actually be talking about subcommands, or
839)         sub-subcommands, or sub-sub-subcommands, etc., which is what the
840)         "here" is supposed to indicate.
841)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

842)         msg="""
843)         A subcommand will be required here in v1.0.  See --help for
844)         available subcommands.  Defaulting to subcommand "vault".
845)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

846)         context='deprecation warning message',
847)     )
848) 
849) 
850) class ErrMsgTemplate(enum.Enum):
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

851)     AGENT_REFUSED_LIST_KEYS = _prepare_translatable(
852)         comments=r"""
853)         TRANSLATORS: "loaded keys" being keys loaded into the agent.
854)         """,
855)         msg="""
856)         The SSH agent failed to or refused to supply a list of loaded keys.
857)         """,
858)         context='error message',
859)     )
860)     AGENT_REFUSED_SIGNATURE = _prepare_translatable(
861)         comments=r"""
862)         TRANSLATORS: The message to be signed is the vault UUID, but
863)         there's no space to explain that here, so ideally the error
864)         message does not go into detail.
865)         """,
866)         msg="""
867)         The SSH agent failed to or refused to issue a signature with the
868)         selected key, necessary for deriving a service passphrase.
869)         """,
870)         context='error message',
871)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

872)     CANNOT_CONNECT_TO_AGENT = _prepare_translatable(
873)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

876)         """,
877)         msg='Cannot connect to the SSH agent: {error!s}: {filename!r}.',
878)         context='error message',
879)         flags='python-brace-format',
880)     )
881)     CANNOT_DECODEIMPORT_VAULT_SETTINGS = _prepare_translatable(
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

882)         comments=r"""
883)         TRANSLATORS: "error" is supplied by the operating system
884)         (errno/strerror).
885)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

886)         msg='Cannot import vault settings: cannot decode JSON: {error!s}.',
887)         context='error message',
888)         flags='python-brace-format',
889)     )
890)     CANNOT_EXPORT_VAULT_SETTINGS = _prepare_translatable(
891)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

894)         """,
895)         msg='Cannot export vault settings: {error!s}: {filename!r}.',
896)         context='error message',
897)         flags='python-brace-format',
898)     )
899)     CANNOT_IMPORT_VAULT_SETTINGS = _prepare_translatable(
900)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

903)         """,
904)         msg='Cannot import vault settings: {error!s}: {filename!r}.',
905)         context='error message',
906)         flags='python-brace-format',
907)     )
908)     CANNOT_LOAD_USER_CONFIG = _prepare_translatable(
909)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

912)         """,
913)         msg='Cannot load user config: {error!s}: {filename!r}.',
914)         context='error message',
915)         flags='python-brace-format',
916)     )
917)     CANNOT_LOAD_VAULT_SETTINGS = _prepare_translatable(
918)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

921)         """,
922)         msg='Cannot load vault settings: {error!s}: {filename!r}.',
923)         context='error message',
924)         flags='python-brace-format',
925)     )
926)     CANNOT_PARSE_AS_VAULT_CONFIG = _prepare_translatable(
927)         comments=r"""
928)         TRANSLATORS: Unlike the "Cannot load {path!r} as a {fmt!s} vault
929)         configuration." message, *this* error message is emitted when we
930)         have tried loading the path in each of our supported formats,
931)         and failed.  The user will thus see the above "Cannot load ..."
932)         warning message potentially multiple times, and this error
933)         message at the very bottom.
934)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

935)         msg=r"""
936)         Cannot parse {path!r} as a valid vault-native configuration
937)         file/directory.
938)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

939)         context='error message',
940)         flags='python-brace-format',
941)     )
942)     CANNOT_STORE_VAULT_SETTINGS = _prepare_translatable(
943)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

946)         """,
947)         msg='Cannot store vault settings: {error!s}: {filename!r}.',
948)         context='error message',
949)         flags='python-brace-format',
950)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

951)     CANNOT_UNDERSTAND_AGENT = _prepare_translatable(
952)         comments=r"""
953)         TRANSLATORS: This error message is used whenever we cannot make
954)         any sense of a response from the SSH agent because the response
955)         is ill-formed (truncated, improperly encoded, etc.) or otherwise
956)         violates the communications protocol.  Well-formed responses
957)         that adhere to the protocol, even if they indicate that the
958)         requested operation failed, are handled with a different error
959)         message.
960)         """,
961)         msg="""
962)         Cannot understand the SSH agent's response because it violates
963)         the communications protocol.
964)         """,
965)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

967)         msg=r"""
968)         Cannot update {settings_type!s} settings without any given
969)         settings.  You must specify at least one of --lower, ...,
970)         --symbol, or --phrase or --key.
971)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

972)         comments='',
973)         context='error message',
974)         flags='python-brace-format',
975)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

976)     INVALID_USER_CONFIG = _prepare_translatable(
977)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

980)         """,
981)         msg=r"""
982)         The user configuration file is invalid.  {error!s}: {filename!r}.
983)         """,
984)         context='error message',
985)         flags='python-brace-format',
986)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

987)     INVALID_VAULT_CONFIG = _prepare_translatable(
988)         comments=r"""
989)         TRANSLATORS: This error message is a reaction to a validator
990)         function saying *that* the configuration is not valid, but not
991)         *how* it is not valid.  The configuration file is principally
992)         parsable, however.
993)         """,
994)         msg='Invalid vault config: {config!r}.',
995)         context='error message',
996)         flags='python-brace-format',
997)     )
998)     MISSING_MODULE = _prepare_translatable(
999)         'Cannot load the required Python module {module!r}.',
1000)         comments='',
1001)         context='error message',
1002)         flags='python-brace-format',
1003)     )
1004)     NO_AF_UNIX = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1005)         msg=r"""
1006)         Cannot connect to an SSH agent because this Python version does
1007)         not support UNIX domain sockets.
1008)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1009)         comments='',
1010)         context='error message',
1011)     )
1012)     NO_KEY_OR_PHRASE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1013)         msg=r"""
1014)         No passphrase or key was given in the configuration.  In this
1015)         case, the --phrase or --key argument is required.
1016)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1017)         comments='',
1018)         context='error message',
1019)     )
1020)     NO_SSH_AGENT_FOUND = _prepare_translatable(
1021)         'Cannot find any running SSH agent because SSH_AUTH_SOCK is not set.',
1022)         comments='',
1023)         context='error message',
1024)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1025)     NO_SUITABLE_SSH_KEYS = _prepare_translatable(
1026)         msg="""
1027)         The SSH agent contains no keys suitable for {PROG_NAME!s}.
1028)         """,  # noqa: RUF027
1029)         comments='',
1030)         context='error message',
1031)         flags='python-brace-format',
1032)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1033)     PARAMS_MUTUALLY_EXCLUSIVE = _prepare_translatable(
1034)         comments=r"""
1035)         TRANSLATORS: The params are long-form command-line option names.
1036)         Typical example: "--key is mutually exclusive with --phrase."
1037)         """,
1038)         msg='{param1!s} is mutually exclusive with {param2!s}.',
1039)         context='error message',
1040)         flags='python-brace-format',
1041)     )
1042)     PARAMS_NEEDS_SERVICE_OR_CONFIG = _prepare_translatable(
1043)         comments=r"""
1044)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

1048)         context='error message',
1049)         flags='python-brace-format',
1050)     )
1051)     PARAMS_NEEDS_SERVICE = _prepare_translatable(
1052)         comments=r"""
1053)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

1057)         context='error message',
1058)         flags='python-brace-format',
1059)     )
1060)     PARAMS_NO_SERVICE = _prepare_translatable(
1061)         comments=r"""
1062)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

1066)         context='error message',
1067)         flags='python-brace-format',
1068)     )
1069)     SERVICE_REQUIRED = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 1 week ago

1072)         """,
1073)         msg='Deriving a passphrase requires a {service_metavar!s}.',
1074)         context='error message',
1075)         flags='python-brace-format',
1076)     )
1077)     SET_AND_UNSET_SAME_SETTING = _prepare_translatable(
1078)         comments=r"""
1079)         TRANSLATORS: The rephrasing "Attempted to unset and set the same
1080)         setting (--unset={setting!s} --{setting!s}=...) at the same
1081)         time." may or may not be more suitable as a basis for
1082)         translation instead.
1083)         """,
1084)         msg='Attempted to unset and set --{setting!s} at the same time.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

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

Marco Ricci authored 1 week ago

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

Marco Ricci authored 2 weeks ago

1087)     )
1088)     SSH_KEY_NOT_LOADED = _prepare_translatable(
1089)         'The requested SSH key is not loaded into the agent.',
1090)         comments='',
1091)         context='error message',
1092)     )
1093)     USER_ABORTED_EDIT = _prepare_translatable(
1094)         'Not saving any new notes: the user aborted the request.',
1095)         comments='',
1096)         context='error message',
1097)     )
1098)     USER_ABORTED_PASSPHRASE = _prepare_translatable(
1099)         'No passphrase was given; the user aborted the request.',
1100)         comments='',
1101)         context='error message',
1102)     )
1103)     USER_ABORTED_SSH_KEY_SELECTION = _prepare_translatable(
1104)         'No SSH key was selected; the user aborted the request.',
1105)         comments='',
1106)         context='error message',
1107)     )